body.system-workspace-open .system-control-layout:has(.ticket-sidebar-modern) {
  grid-template-columns: minmax(0, 1fr) 282px;
}

body.system-workspace-open .ticket-sidebar-modern {
  --ticket-side-accent: #a89a83;
  min-height: 100vh !important;
  padding: 0 0 14px !important;
  background: #15120e !important;
  background-image: none !important;
  border-inline-start: 1px solid rgba(129,104,78, .16) !important;
}

body.system-workspace-open .ticket-sidebar-modern .system-server-profile {
  padding: 30px 18px 20px;
  border-bottom: 1px solid rgba(129,104,78, .13);
}

body.system-workspace-open .ticket-sidebar-modern .system-server-banner { display: none; }

body.system-workspace-open .ticket-sidebar-modern .system-server-profile > img {
  width: 68px;
  height: 68px;
  margin: 0 auto 10px;
  border: 2px solid rgba(129,104,78, .55);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .42);
}

body.system-workspace-open .ticket-sidebar-modern .system-server-profile strong {
  color: #f2ede4;
  font-size: 14px;
}

body.system-workspace-open .ticket-sidebar-modern .system-server-profile small {
  color: #a89a83;
  font-size: 10px;
}

body.system-workspace-open .ticket-sidebar-modern nav {
  flex: 1;
  display: flex !important;
  flex-direction: column;
  gap: 1px;
  padding: 8px 0 16px;
}

body.system-workspace-open .ticket-sidebar-modern .ticket-side-group {
  padding: 14px 18px 6px;
  color: var(--ticket-side-accent);
  font-size: 9px;
  font-weight: 800;
  text-align: right;
}

body.system-workspace-open .ticket-sidebar-modern nav button {
  width: calc(100% - 16px);
  height: 42px;
  margin: 1px 8px;
  padding: 0 13px;
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: #c2b6a1 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 8px;
  box-shadow: none !important;
  backdrop-filter: none;
  font-size: 11px;
  font-weight: 700;
}

body.system-workspace-open .ticket-sidebar-modern nav button i {
  color: #a89a83;
}

body.system-workspace-open .ticket-sidebar-modern nav button svg {
  width: 17px;
  height: 17px;
}

body.system-workspace-open .ticket-sidebar-modern nav button:hover:not(:disabled) {
  color: #f2ede4 !important;
  background: rgba(129,104,78, .06) !important;
  border-color: rgba(129,104,78, .15) !important;
}

body.system-workspace-open .ticket-sidebar-modern nav button.active,
body.system-workspace-open .ticket-sidebar-modern nav button.active:hover {
  color: var(--ticket-side-accent) !important;
  background: linear-gradient(90deg, rgba(129,104,78, .05), rgba(129,104,78, .16)) !important;
  border-color: rgba(129,104,78, .22) !important;
  box-shadow: inset -2px 0 var(--ticket-side-accent) !important;
}

body.system-workspace-open .ticket-sidebar-modern nav button.active i {
  color: var(--ticket-side-accent) !important;
}

body.system-workspace-open .ticket-sidebar-modern nav .ticket-side-future {
  opacity: .5;
  cursor: default;
}

body.system-workspace-open .ticket-sidebar-modern #systemBackHomeButton.ticket-sidebar-back {
  position: static !important;
  inset: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 50px !important;
  margin: auto 0 0 !important;
  padding: 0 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px;
  color: #a89a83 !important;
  background: transparent !important;
  border: 0 !important;
  border-top: 1px solid rgba(129,104,78, .12) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 11px !important;
}

body.system-workspace-open .ticket-sidebar-modern .ticket-sidebar-back svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 900px) {
  body.system-workspace-open .system-control-layout:has(.ticket-sidebar-modern) { grid-template-columns: 1fr; }
  body.system-workspace-open .ticket-sidebar-modern { min-height: 0 !important; }
}

/* Unified centered loading states for bot-management workspaces. */
.multi-workspace-page > .system-commands-state.loading {
  width: min(520px, calc(100% - 32px));
  min-height: 320px;
  margin: max(50px, 12vh) auto 0;
  padding: 42px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 15px;
  color: #c2b6a1;
  background: radial-gradient(circle at 50% 42%, rgba(129,104,78, .11), transparent 34%), #15120e;
  border: 1px solid rgba(129,104,78, .22);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .24);
  text-align: center;
}

.multi-workspace-page > .system-commands-state.loading::before,
.multi-loading::before {
  content: "";
  width: 42px;
  height: 42px;
  display: block;
  border: 3px solid rgba(129,104,78, .2);
  border-top-color: #3d362b;
  border-radius: 50%;
  animation: norelUnifiedLoadingSpin .72s linear infinite;
}

.multi-workspace-page > .system-commands-state.loading > i { display: none; }

.multi-workspace-page > .system-commands-state.loading strong {
  color: #f2ede4;
  font: 800 14px/1.8 "Cairo", sans-serif;
}

.multi-loading {
  min-height: 260px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}

body.system-workspace-open .system-quick-loading {
  min-height: 280px;
  gap: 14px;
  background: radial-gradient(circle at center, rgba(129,104,78, .08), transparent 42%), #15120e;
  border-color: rgba(129,104,78, .22);
}

body.system-workspace-open .system-quick-loading i {
  width: 42px;
  height: 42px;
  border-color: rgba(129,104,78, .2);
  border-top-color: #3d362b;
  animation-duration: .72s;
}

body.system-workspace-open .system-quick-loading span {
  color: #c2b6a1;
  font-size: 12px;
  font-weight: 700;
}

@keyframes norelUnifiedLoadingSpin { to { transform: rotate(360deg); } }

/* Ticket overview — store identity, with Motion-enhanced hover gestures. */
body.system-workspace-open .ticket-overview-page {
  --ticket-accent: #a89a83;
  --ticket-accent-soft: rgba(129,104,78, .14);
  margin: 0;
}

body.system-workspace-open .ticket-overview-page .managed-page-head { margin-bottom: 22px; }
body.system-workspace-open .ticket-overview-page .managed-page-head h1 { font-size: 24px; }
body.system-workspace-open .ticket-overview-page .managed-page-head p { font-size: 12px; }

body.system-workspace-open .ticket-overview-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

body.system-workspace-open .ticket-overview-stats article,
body.system-workspace-open .ticket-overview-panel {
  border: 1px solid #3d362b;
  background: #1e1a14;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .12);
  transition: border-color .22s ease, box-shadow .22s ease, background .22s ease;
  will-change: transform;
}

body.system-workspace-open .ticket-overview-stats article:hover,
body.system-workspace-open .ticket-overview-panel:hover {
  border-color: var(--ticket-accent);
  background: #1e1a14;
  box-shadow: 0 0 0 3px rgba(129,104,78, .1), 0 18px 44px rgba(0, 0, 0, .24), 0 0 24px rgba(129,104,78, .12);
}

body.system-workspace-open .ticket-overview-stats article {
  min-width: 0;
  min-height: 82px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 14px;
}

body.system-workspace-open .ticket-overview-stats article > span {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  color: #c6b9a2;
  background: var(--ticket-accent-soft);
  border: 1px solid rgba(129,104,78, .18);
  border-radius: 11px;
}

body.system-workspace-open .ticket-overview-stats svg { width: 19px; height: 19px; }
body.system-workspace-open .ticket-overview-stats article div { min-width: 0; }
body.system-workspace-open .ticket-overview-stats strong { display: block; color: #f2ede4; font-size: 24px; line-height: 1.1; }
body.system-workspace-open .ticket-overview-stats small { display: block; margin-top: 6px; overflow: hidden; color: #a89a83; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

body.system-workspace-open .ticket-overview-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, .85fr);
  gap: 14px;
}

body.system-workspace-open .ticket-overview-panel {
  min-width: 0;
  overflow: hidden;
  border-radius: 18px;
}

body.system-workspace-open .ticket-overview-panel > header {
  min-height: 58px;
  padding: 0 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #3d362b;
}

body.system-workspace-open .ticket-overview-panel > header > div { display: flex; align-items: center; gap: 9px; }
body.system-workspace-open .ticket-overview-panel > header span { width: 30px; height: 30px; display: grid; place-items: center; color: #c6b9a2; background: var(--ticket-accent-soft); border-radius: 9px; }
body.system-workspace-open .ticket-overview-panel > header svg { width: 16px; height: 16px; }
body.system-workspace-open .ticket-overview-panel > header strong { color: #f2ede4; font-size: 14px; }
body.system-workspace-open .ticket-overview-panel > header small { padding: 6px 9px; color: #c2b6a1; background: rgba(129,104,78, .08); border: 1px solid rgba(129,104,78, .14); border-radius: 8px; font-size: 10px; font-weight: 800; }

body.system-workspace-open .ticket-chart-wrap { padding: 8px 12px 11px; }
body.system-workspace-open .ticket-chart-wrap svg { display: block; width: 100%; min-height: 230px; }
body.system-workspace-open .ticket-chart-wrap line { stroke: rgba(255,255,255,.055); stroke-width: 1; }
body.system-workspace-open .ticket-chart-wrap text { fill: #9c907d; font: 10px Cairo, sans-serif; }
body.system-workspace-open .ticket-chart-line { fill: none; stroke: var(--ticket-accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(129,104,78, .3)); }
body.system-workspace-open .ticket-chart-wrap circle { fill: #15120e; stroke: #c6b9a2; stroke-width: 2.5; transition: r .18s ease, filter .18s ease; }
body.system-workspace-open .ticket-chart-wrap circle:hover { r: 6px; filter: drop-shadow(0 0 6px rgba(196, 165, 156, .8)); }

body.system-workspace-open .ticket-team-list { min-height: 250px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
body.system-workspace-open .ticket-team-list > div:not(.ticket-panel-empty) { min-height: 48px; padding: 7px 10px; display: grid; grid-template-columns: 28px 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 1px solid #3d362b; border-radius: 11px; background: #1e1a14; }
body.system-workspace-open .ticket-team-list b { width: 25px; height: 25px; display: grid; place-items: center; color: #c6b9a2; background: var(--ticket-accent-soft); border-radius: 8px; font-size: 11px; }
body.system-workspace-open .ticket-team-list img { width: 34px; height: 34px; object-fit: cover; border: 1px solid rgba(129,104,78, .3); border-radius: 50%; }
body.system-workspace-open .ticket-team-list span { min-width: 0; }
body.system-workspace-open .ticket-team-list strong { display: block; overflow: hidden; color: #f2ede4; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
body.system-workspace-open .ticket-team-list small { color: #a89a83; font-size: 10px; }
body.system-workspace-open .ticket-team-list em { color: #c6b9a2; font-size: 14px; font-style: normal; font-weight: 900; }

body.system-workspace-open .ticket-recent-panel { margin-top: 14px; }
body.system-workspace-open .ticket-recent-head,
body.system-workspace-open .ticket-recent-list > div:not(.ticket-panel-empty) { padding: 0 17px; display: grid; grid-template-columns: 48px 1.25fr 1.25fr .7fr 1fr; align-items: center; gap: 12px; }
body.system-workspace-open .ticket-recent-head { min-height: 42px; color: #a89a83; border-bottom: 1px solid #3d362b; font-size: 10px; font-weight: 800; }
body.system-workspace-open .ticket-recent-list > div:not(.ticket-panel-empty) { min-height: 48px; color: #a89a83; border-bottom: 1px solid rgba(129,104,78, .07); font-size: 11px; }
body.system-workspace-open .ticket-recent-list > div:last-child { border-bottom: 0; }
body.system-workspace-open .ticket-recent-list strong { overflow: hidden; color: #c2b6a1; text-overflow: ellipsis; white-space: nowrap; }
body.system-workspace-open .ticket-recent-list code { color: #a89a83; font: 10px Cairo, sans-serif; }
body.system-workspace-open .ticket-recent-list em { width: fit-content; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 800; }
body.system-workspace-open .ticket-recent-list em.open { color: #c6b9a2; background: rgba(129,104,78, .14); }
body.system-workspace-open .ticket-recent-list em.closed { color: #a89a83; background: rgba(132, 126, 123, .12); }
body.system-workspace-open .ticket-recent-user { display: flex; align-items: center; gap: 8px; }
body.system-workspace-open .ticket-recent-user img { width: 28px; height: 28px; flex: 0 0 28px; object-fit: cover; border-radius: 50%; }
body.system-workspace-open .ticket-recent-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Ticket roles, specialists and team statistics. */
body.system-workspace-open .ticket-staff-page { --ticket-team-accent: #a89a83; }
body.system-workspace-open .ticket-staff-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
body.system-workspace-open .ticket-staff-card,
body.system-workspace-open .ticket-reason-roles,
body.system-workspace-open .ticket-team-statistics { overflow: hidden; border: 1px solid #3d362b; border-radius: 17px; background: #1e1a14; }
body.system-workspace-open .ticket-staff-card > header,
body.system-workspace-open .ticket-reason-role-card > header,
body.system-workspace-open .ticket-team-statistics > header { min-height: 55px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #3d362b; }
body.system-workspace-open .ticket-staff-card > header > div,
body.system-workspace-open .ticket-reason-role-card > header > div,
body.system-workspace-open .ticket-team-statistics > header > div { display: flex; align-items: center; gap: 9px; }
body.system-workspace-open .ticket-staff-card header svg,
body.system-workspace-open .ticket-reason-roles header svg,
body.system-workspace-open .ticket-team-statistics header svg { width: 18px; height: 18px; color: #c6b9a2; }
body.system-workspace-open .ticket-staff-card header strong,
body.system-workspace-open .ticket-reason-roles header strong,
body.system-workspace-open .ticket-team-statistics header strong { color: #f2ede4; font-size: 14px; }
body.system-workspace-open .ticket-staff-card header small,
body.system-workspace-open .ticket-reason-role-card header small,
body.system-workspace-open .ticket-team-statistics header small { min-width: 28px; padding: 4px 8px; color: #c6b9a2; background: rgba(129,104,78, .12); border-radius: 8px; text-align: center; }
body.system-workspace-open .ticket-staff-card > p { margin: 12px 17px 0; color: #a89a83; font-size: 11px; line-height: 1.7; }
body.system-workspace-open .ticket-staff-add { padding: 14px 17px 10px; display: flex; align-items: stretch; gap: 8px; }
body.system-workspace-open .ticket-staff-add input,
body.system-workspace-open .ticket-staff-add select { min-width: 0; height: 44px; flex: 1; padding: 0 13px; color: #26211a; background: #1e1a14; border: 1px solid #3d362b; border-radius: 10px; outline: none; }
body.system-workspace-open .ticket-staff-add input:focus,
body.system-workspace-open .ticket-staff-add select:focus { border-color: var(--ticket-team-accent); box-shadow: 0 0 0 3px rgba(129,104,78, .1); }
body.system-workspace-open .ticket-staff-add button { height: 44px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; color: #fff; background: var(--ticket-team-accent); border: 0; border-radius: 10px; font: 800 11px Cairo, sans-serif; cursor: pointer; }
body.system-workspace-open .ticket-staff-add button svg { width: 16px; height: 16px; }
body.system-workspace-open .ticket-staff-card ul,
body.system-workspace-open .ticket-reason-role-card ul { min-height: 74px; max-height: 190px; margin: 0; padding: 3px 17px 14px; display: flex; flex-direction: column; gap: 7px; overflow: auto; list-style: none; }
body.system-workspace-open .ticket-staff-card li,
body.system-workspace-open .ticket-reason-role-card li { min-height: 46px; padding: 7px 9px; display: flex; align-items: center; gap: 9px; color: #26211a; background: #1e1a14; border: 1px solid #3d362b; border-radius: 10px; }
body.system-workspace-open .ticket-staff-card li > img { width: 32px; height: 32px; object-fit: cover; border-radius: 50%; }
body.system-workspace-open .ticket-staff-card li > span:nth-last-of-type(1),
body.system-workspace-open .ticket-reason-role-card li > span:nth-last-of-type(1) { min-width: 0; flex: 1; }
body.system-workspace-open .ticket-staff-card li strong,
body.system-workspace-open .ticket-reason-role-card li strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
body.system-workspace-open .ticket-staff-card li small,
body.system-workspace-open .ticket-reason-role-card li small { display: block; color: #c2b6a1; font-size: 9px; }
body.system-workspace-open .ticket-staff-card li button,
body.system-workspace-open .ticket-reason-role-card li button { width: 27px; height: 27px; display: grid; place-items: center; color: #c2b6a1; background: transparent; border: 0; border-radius: 7px; cursor: pointer; }
body.system-workspace-open .ticket-staff-card li button:hover,
body.system-workspace-open .ticket-reason-role-card li button:hover { color: #fff; background: rgba(129,104,78, .18); }
body.system-workspace-open .ticket-staff-card li button svg,
body.system-workspace-open .ticket-reason-role-card li button svg { width: 15px; height: 15px; }
body.system-workspace-open .ticket-role-dot { width: 10px; height: 10px; flex: 0 0 10px; background: #a89a83; border-radius: 50%; box-shadow: 0 0 0 4px rgba(129,104,78, .1); }
body.system-workspace-open li.ticket-staff-empty { justify-content: center; color: #a89a83; border-style: dashed; }
body.system-workspace-open .ticket-combined-team li button { display: none; }
body.system-workspace-open .ticket-reason-roles,
body.system-workspace-open .ticket-team-statistics { margin-top: 15px; }
body.system-workspace-open .ticket-reason-roles > header { padding: 15px 17px; border-bottom: 1px solid #3d362b; }
body.system-workspace-open .ticket-reason-roles > header > div { display: flex; align-items: center; gap: 9px; }
body.system-workspace-open .ticket-reason-roles > header p { margin: 5px 0 0; color: #a89a83; font-size: 11px; }
body.system-workspace-open .ticket-reason-roles > div { padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body.system-workspace-open .ticket-reason-role-card { overflow: hidden; border: 1px solid #3d362b; border-radius: 13px; background: #1e1a14; }
body.system-workspace-open .ticket-team-table { overflow-x: auto; }
body.system-workspace-open .ticket-team-table-head,
body.system-workspace-open .ticket-team-table > div:not(.ticket-team-table-head):not(.ticket-team-empty-wide) { min-width: 650px; min-height: 52px; padding: 0 17px; display: grid; grid-template-columns: 44px minmax(180px, 1.5fr) repeat(3, minmax(95px, .7fr)); align-items: center; gap: 10px; border-bottom: 1px solid rgba(129,104,78, .08); }
body.system-workspace-open .ticket-team-table-head { min-height: 46px; color: #a89a83; font-size: 12px; font-weight: 800; }
body.system-workspace-open .ticket-team-table > div:not(.ticket-team-table-head) { color: #c2b6a1; font-size: 13px; }
body.system-workspace-open .ticket-team-table > div > strong { display: flex; align-items: center; gap: 9px; }
body.system-workspace-open .ticket-team-table > div > strong img { width: 33px; height: 33px; object-fit: cover; border-radius: 50%; }
body.system-workspace-open .ticket-team-table > div > strong i { min-width: 0; font-style: normal; }
body.system-workspace-open .ticket-team-table > div > strong b { display: block; overflow: hidden; color: #f2ede4; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
body.system-workspace-open .ticket-team-table > div > strong small { display: block; color: #a89a83; font-size: 11px; }
body.system-workspace-open .ticket-team-table em { color: #c2b6a1; font-size: 13px; font-style: normal; }
body.system-workspace-open .ticket-team-table > div > b { color: #c2b6a1; font-size: 14px; }
body.system-workspace-open .ticket-team-empty-wide { min-height: 110px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; color: #a89a83; }
body.system-workspace-open .ticket-team-empty-wide svg { width: 25px; height: 25px; }

/* Ticket reasons manager. */
body.system-workspace-open .ticket-reasons-toolbar { margin-bottom: 13px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #3d362b; border-radius: 14px; background: #1e1a14; }
body.system-workspace-open .ticket-reasons-toolbar > div { display: flex; align-items: center; gap: 9px; }
body.system-workspace-open .ticket-reasons-toolbar strong { color: #f2ede4; font-size: 14px; }
body.system-workspace-open .ticket-reasons-toolbar small { padding: 4px 8px; color: #c2b6a1; background: rgba(129,104,78, .12); border-radius: 7px; font-size: 10px; }
body.system-workspace-open .ticket-reasons-toolbar button { height: 41px; padding: 0 14px; display: inline-flex; align-items: center; gap: 7px; color: #fff; background: #a89a83; border: 0; border-radius: 10px; font: 800 11px Cairo, sans-serif; cursor: pointer; }
body.system-workspace-open .ticket-reasons-toolbar button svg { width: 16px; height: 16px; }
body.system-workspace-open .ticket-reasons-list { display: flex; flex-direction: column; gap: 10px; }
body.system-workspace-open .ticket-reason-manage-card { position: relative; min-height: 102px; padding: 13px 15px; display: grid; grid-template-columns: 28px 46px minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid #3d362b; border-radius: 15px; background: #1e1a14; transition: opacity .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
body.system-workspace-open .ticket-reason-manage-card:hover { border-color: #a89a83; transform: translateY(-1px); }
body.system-workspace-open .ticket-reason-manage-card.is-dragging { z-index: 3; opacity: .42; border-color: #a89a83; box-shadow: 0 12px 34px rgba(129,104,78, .16); transform: scale(.985); }
body.system-workspace-open .ticket-reason-manage-card.is-drop-before::before,
body.system-workspace-open .ticket-reason-manage-card.is-drop-after::after { content: ""; position: absolute; z-index: 5; right: 12px; left: 12px; height: 3px; background: #a89a83; border-radius: 99px; box-shadow: 0 0 13px rgba(129,104,78, .72); animation: ticket-reason-drop-pulse .8s ease-in-out infinite alternate; }
body.system-workspace-open .ticket-reason-manage-card.is-drop-before::before { top: -7px; }
body.system-workspace-open .ticket-reason-manage-card.is-drop-after::after { bottom: -7px; }
@keyframes ticket-reason-drop-pulse { from { opacity: .55; transform: scaleX(.97); } to { opacity: 1; transform: scaleX(1); } }
body.system-workspace-open .ticket-reason-drag { width: 28px; height: 35px; display: grid; place-items: center; color: #c2b6a1; background: transparent; border: 0; cursor: grab; touch-action: none; }
body.system-workspace-open .ticket-reason-drag:active { color: #c2b6a1; cursor: grabbing; }
body.system-workspace-open .ticket-reason-drag svg { width: 18px; height: 18px; }
body.system-workspace-open .ticket-reason-emoji { width: 46px; height: 46px; display: grid; place-items: center; overflow: hidden; color: #fff; background: #1e1a14; border-radius: 11px; font-size: 23px; }
body.system-workspace-open .ticket-reason-emoji img { width: 100%; height: 100%; object-fit: cover; }
body.system-workspace-open .ticket-reason-emoji > span { display: grid; place-items: center; line-height: 1; }
body.system-workspace-open .ticket-reason-emoji img.ticket-reason-custom-emoji { object-fit: contain; padding: 5px; }
body.system-workspace-open .ticket-reason-emoji img.ticket-reason-server-icon { object-fit: cover; padding: 0; }
body.system-workspace-open .ticket-reason-manage-card > div { min-width: 0; }
body.system-workspace-open .ticket-reason-manage-card > div strong { display: block; color: #f2ede4; font-size: 13px; }
body.system-workspace-open .ticket-reason-manage-card > div p { margin: 5px 0 0; overflow: hidden; color: #a89a83; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
body.system-workspace-open .ticket-reason-manage-card > div small { margin-top: 7px; display: inline-flex; align-items: center; gap: 5px; color: #c2b6a1; font-size: 9px; }
body.system-workspace-open .ticket-reason-manage-card > div small svg { width: 13px; height: 13px; }
body.system-workspace-open .ticket-reason-manage-card aside { display: flex; gap: 7px; }
body.system-workspace-open .ticket-reason-manage-card aside button { width: 38px; height: 36px; display: grid; place-items: center; color: #c2b6a1; background: #1e1a14; border: 1px solid #3d362b; border-radius: 9px; cursor: pointer; }
body.system-workspace-open .ticket-reason-manage-card aside button:hover { color: #fff; border-color: #a89a83; }
body.system-workspace-open .ticket-reason-manage-card aside button.danger { color: #e57575; background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .16); }
body.system-workspace-open .ticket-reason-manage-card aside svg { width: 16px; height: 16px; }
body.system-workspace-open .ticket-reasons-empty { min-height: 220px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 7px; color: #a89a83; border: 1px dashed #3d362b; border-radius: 15px; background: #1e1a14; }
body.system-workspace-open .ticket-reasons-empty svg { width: 32px; height: 32px; color: #a89a83; }
body.system-workspace-open .ticket-reasons-empty strong { color: #c2b6a1; font-size: 13px; }
body.system-workspace-open .ticket-reasons-empty span { font-size: 10px; }
.ticket-reason-editor { position: fixed; z-index: 10050; inset: 0; padding: 20px; display: grid; place-items: center; background: rgba(7, 7, 9, .78); backdrop-filter: blur(7px); }
.ticket-reason-editor > div { width: min(560px, 100%); overflow: hidden; color: #26211a; background: #1e1a14; border: 1px solid #3d362b; border-radius: 18px; box-shadow: 0 28px 90px rgba(0, 0, 0, .5); }
.ticket-reason-editor header { min-height: 58px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #3d362b; }
.ticket-reason-editor header span { display: flex; align-items: center; gap: 9px; }
.ticket-reason-editor header span svg { width: 18px; height: 18px; color: #c2b6a1; }
.ticket-reason-editor header strong { font-size: 14px; }
.ticket-reason-editor header button { width: 32px; height: 32px; display: grid; place-items: center; color: #a89a83; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.ticket-reason-editor header button svg { width: 17px; height: 17px; }
.ticket-reason-editor label { margin: 14px 17px 0; display: block; }
.ticket-reason-editor label > span { margin-bottom: 6px; display: block; color: #c2b6a1; font-size: 11px; font-weight: 800; }
.ticket-reason-editor input,
.ticket-reason-editor select { width: 100%; height: 44px; padding: 0 12px; color: #26211a; background: #1e1a14; border: 1px solid #3d362b; border-radius: 10px; outline: none; }
.ticket-reason-editor input:focus,
.ticket-reason-editor select:focus { border-color: #a89a83; box-shadow: 0 0 0 3px rgba(129,104,78, .1); }
.ticket-reason-editor-row { display: grid; grid-template-columns: .7fr 1.3fr; }
.ticket-reason-editor footer { margin-top: 17px; padding: 14px 17px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid #3d362b; }
.ticket-reason-editor footer button { height: 40px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; color: #c2b6a1; background: #1e1a14; border: 1px solid #3d362b; border-radius: 9px; font: 800 11px Cairo, sans-serif; cursor: pointer; }
.ticket-reason-editor footer button.primary { color: #fff; background: #a89a83; border-color: #a89a83; }
.ticket-reason-editor footer button svg { width: 15px; height: 15px; }

/* Closed ticket diagnostics and transcript links. */
body.system-workspace-open .ticket-diagnostics-toolbar { margin-bottom: 12px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #3d362b; border-radius: 14px; background: #1e1a14; }
body.system-workspace-open .ticket-diagnostics-toolbar > div { display: flex; align-items: center; gap: 9px; }
body.system-workspace-open .ticket-diagnostics-toolbar > div > svg { width: 19px; height: 19px; color: #c2b6a1; }
body.system-workspace-open .ticket-diagnostics-toolbar > div span { display: flex; align-items: center; gap: 8px; }
body.system-workspace-open .ticket-diagnostics-toolbar strong { color: #f2ede4; font-size: 14px; }
body.system-workspace-open .ticket-diagnostics-toolbar small { padding: 3px 8px; color: #c2b6a1; background: rgba(129,104,78, .12); border-radius: 7px; }
body.system-workspace-open .ticket-diagnostics-toolbar label { width: min(330px, 48%); height: 41px; padding: 0 11px; display: flex; align-items: center; gap: 8px; background: #1e1a14; border: 1px solid #3d362b; border-radius: 10px; }
body.system-workspace-open .ticket-diagnostics-toolbar label svg { width: 16px; height: 16px; color: #a89a83; }
body.system-workspace-open .ticket-diagnostics-toolbar input { min-width: 0; width: 100%; color: #f2ede4; background: transparent; border: 0; outline: 0; font: 11px Cairo, sans-serif; }
body.system-workspace-open .ticket-diagnostics-list { max-height: 680px; display: flex; flex-direction: column; gap: 8px; overflow: auto; }
body.system-workspace-open .ticket-diagnostic-row { min-height: 68px; padding: 10px 13px; display: grid; grid-template-columns: 34px 38px minmax(180px, 1fr) minmax(155px, .65fr) auto; align-items: center; gap: 10px; border: 1px solid #3d362b; border-radius: 12px; background: #1e1a14; }
body.system-workspace-open .ticket-diagnostic-row[hidden] { display: none !important; }
body.system-workspace-open .ticket-diagnostic-row > b { color: #a89a83; font-size: 10px; }
body.system-workspace-open .ticket-diagnostic-icon { width: 36px; height: 36px; display: grid; place-items: center; color: #c2b6a1; background: rgba(129,104,78, .11); border-radius: 10px; }
body.system-workspace-open .ticket-diagnostic-icon svg { width: 17px; height: 17px; }
body.system-workspace-open .ticket-diagnostic-row > div { min-width: 0; }
body.system-workspace-open .ticket-diagnostic-row > div strong { display: block; overflow: hidden; color: #f2ede4; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
body.system-workspace-open .ticket-diagnostic-row > div small { display: block; margin-top: 3px; color: #a89a83; font-size: 9px; }
body.system-workspace-open .ticket-diagnostic-row time { color: #a89a83; font-size: 10px; }
body.system-workspace-open .ticket-diagnostic-row a { height: 36px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; color: #fff; background: #a89a83; border-radius: 9px; font-size: 10px; font-weight: 800; text-decoration: none; }
body.system-workspace-open .ticket-diagnostic-row a svg { width: 14px; height: 14px; }
body.system-workspace-open .ticket-diagnostics-empty { min-height: 230px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 9px; color: #a89a83; border: 1px dashed #3d362b; border-radius: 14px; }
body.system-workspace-open .ticket-diagnostics-empty svg { width: 34px; height: 34px; }

/* Ticket options: images first, then unified database toggles. */
body.system-workspace-open .ticket-options-page { --ticket-option-accent: #a89a83; }
body.system-workspace-open .ticket-options-images,
body.system-workspace-open .ticket-options-toggles { overflow: hidden; border: 1px solid #3d362b; border-radius: 17px; background: #1e1a14; }
body.system-workspace-open .ticket-options-toggles { margin-top: 15px; }
body.system-workspace-open .ticket-options-images > header,
body.system-workspace-open .ticket-options-toggles > header { padding: 15px 17px; border-bottom: 1px solid #3d362b; }
body.system-workspace-open .ticket-options-images > header > div,
body.system-workspace-open .ticket-options-toggles > header > div { display: flex; align-items: center; gap: 9px; }
body.system-workspace-open .ticket-options-images > header svg,
body.system-workspace-open .ticket-options-toggles > header svg { width: 18px; height: 18px; color: #c6b9a2; }
body.system-workspace-open .ticket-options-images > header strong,
body.system-workspace-open .ticket-options-toggles > header strong { color: #f2ede4; font-size: 14px; }
body.system-workspace-open .ticket-options-images > header p,
body.system-workspace-open .ticket-options-toggles > header p { margin: 5px 0 0; color: #a89a83; font-size: 11px; }
body.system-workspace-open .ticket-options-images > div { padding: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
body.system-workspace-open .ticket-option-image { overflow: hidden; border: 1px solid #3d362b; border-radius: 13px; background: #1e1a14; }
body.system-workspace-open .ticket-option-image > header { min-height: 48px; padding: 0 13px; display: flex; align-items: center; gap: 8px; color: #f2ede4; border-bottom: 1px solid #3d362b; }
body.system-workspace-open .ticket-option-image > header svg { width: 16px; height: 16px; color: #c2b6a1; }
body.system-workspace-open .ticket-option-image > header strong { font-size: 12px; }
body.system-workspace-open .ticket-option-file { display: none; }
body.system-workspace-open .ticket-option-image-preview { position: relative; height: 150px; margin: 12px; display: grid; place-items: center; overflow: hidden; color: #c2b6a1; background: #1e1a14; border: 1px dashed #3d362b; border-radius: 11px; cursor: pointer; }
body.system-workspace-open .ticket-option-image-preview:hover { border-color: #a89a83; background: #1e1a14; }
body.system-workspace-open .ticket-option-image-preview img { width: 100%; height: 100%; object-fit: contain; }
body.system-workspace-open .ticket-option-image-preview > span { display: none; align-items: center; justify-content: center; flex-direction: column; gap: 7px; font-size: 10px; }
body.system-workspace-open .ticket-option-image-preview:not(:has(img)) > span,
body.system-workspace-open .ticket-option-image-preview.empty > span { display: flex; }
body.system-workspace-open .ticket-option-image-preview.empty img { display: none; }
body.system-workspace-open .ticket-option-image-preview span svg { width: 25px; height: 25px; }
body.system-workspace-open .ticket-option-image-preview.uploading::after { content: ""; position: absolute; width: 27px; height: 27px; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; animation: norelUnifiedLoadingSpin .75s linear infinite; }
body.system-workspace-open .ticket-option-image-preview.uploading img { opacity: .35; }
body.system-workspace-open .ticket-option-image-input { padding: 0 12px 12px; display: flex; gap: 7px; }
body.system-workspace-open .ticket-option-image-input input { min-width: 0; height: 40px; flex: 1; padding: 0 11px; color: #26211a; background: #1e1a14; border: 1px solid #3d362b; border-radius: 9px; outline: none; direction: ltr; }
body.system-workspace-open .ticket-option-image-input input:focus { border-color: var(--ticket-option-accent); }
body.system-workspace-open .ticket-option-image-input button { width: 40px; height: 40px; display: grid; place-items: center; color: #c2b6a1; background: rgba(129,104,78, .1); border: 0; border-radius: 9px; cursor: pointer; }
body.system-workspace-open .ticket-option-image-input button svg { width: 15px; height: 15px; }
body.system-workspace-open .ticket-options-toggles > div { padding: 0 17px; }
body.system-workspace-open .ticket-option-toggle { min-height: 68px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid rgba(129,104,78, .09); cursor: pointer; }
body.system-workspace-open .ticket-option-toggle:last-child { border-bottom: 0; }
body.system-workspace-open .ticket-option-toggle:has(#ticketShowOwner),
body.system-workspace-open .ticket-option-toggle:has(#ticketShowReceived),
body.system-workspace-open .ticket-option-toggle:has(#ticketShowClaimer) { display: none !important; }
body.system-workspace-open .ticket-option-icon { width: 35px; height: 35px; flex: 0 0 35px; display: grid; place-items: center; color: #c2b6a1; background: rgba(129,104,78, .1); border-radius: 10px; }
body.system-workspace-open .ticket-option-icon svg { width: 17px; height: 17px; }
body.system-workspace-open .ticket-option-copy { min-width: 0; flex: 1; }
body.system-workspace-open .ticket-option-copy strong { display: block; color: #f2ede4; font-size: 13px; }
body.system-workspace-open .ticket-option-copy small { display: block; margin-top: 3px; color: #a89a83; font-size: 10px; }
body.system-workspace-open .ticket-option-toggle > input { position: absolute; opacity: 0; pointer-events: none; }
body.system-workspace-open .ticket-option-switch { position: relative; width: 45px; height: 24px; flex: 0 0 45px; background: #302a20; border: 1px solid #3d362b; border-radius: 999px; transition: .2s ease; }
body.system-workspace-open .ticket-option-switch::after { content: ""; position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; background: #a89a83; border-radius: 50%; transition: .2s ease; }
body.system-workspace-open .ticket-option-toggle > input:checked + .ticket-option-switch { background: #a89a83; border-color: #3d362b; box-shadow: 0 0 0 3px rgba(129,104,78, .1); }
body.system-workspace-open .ticket-option-toggle > input:checked + .ticket-option-switch::after { right: 24px; background: #fff; }
body.system-workspace-open .ticket-option-cooldown { margin: 0 17px 17px; padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 15px; background: #1e1a14; border: 1px solid #3d362b; border-radius: 11px; }
body.system-workspace-open .ticket-option-cooldown strong { display: block; color: #f2ede4; font-size: 12px; }
body.system-workspace-open .ticket-option-cooldown small { display: block; margin-top: 3px; color: #a89a83; font-size: 10px; }
body.system-workspace-open .ticket-option-cooldown input { width: 150px; height: 40px; padding: 0 11px; color: #26211a; background: #1e1a14; border: 1px solid #3d362b; border-radius: 9px; outline: none; direction: ltr; text-align: left; }

body.system-workspace-open .ticket-panel-empty { min-height: 190px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; color: #a89a83; font-size: 12px; }
body.system-workspace-open .ticket-panel-empty svg { width: 30px; height: 30px; color: #a89a83; }
body.system-workspace-open .ticket-recent-list .ticket-panel-empty { min-height: 130px; }

@media (max-width: 1250px) {
  body.system-workspace-open .ticket-overview-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  body.system-workspace-open .ticket-overview-grid { grid-template-columns: 1fr; }
  body.system-workspace-open .ticket-chart-wrap svg { min-height: 190px; }
  body.system-workspace-open .ticket-staff-grid,
  body.system-workspace-open .ticket-reason-roles > div,
  body.system-workspace-open .ticket-options-images > div { grid-template-columns: 1fr; }
  body.system-workspace-open .ticket-diagnostic-row { grid-template-columns: 30px 36px minmax(0, 1fr) auto; }
  body.system-workspace-open .ticket-diagnostic-row time { display: none; }
}

@media (max-width: 600px) {
  body.system-workspace-open .ticket-overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.system-workspace-open .ticket-recent-head { display: none; }
  body.system-workspace-open .ticket-recent-list > div:not(.ticket-panel-empty) { padding: 12px 14px; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; }
  body.system-workspace-open .ticket-recent-list > div > span:nth-child(3),
  body.system-workspace-open .ticket-recent-list code { display: none; }
  body.system-workspace-open .ticket-reason-manage-card { grid-template-columns: 22px 40px minmax(0, 1fr); }
  body.system-workspace-open .ticket-reason-manage-card aside { grid-column: 2 / -1; justify-content: flex-end; }
  .ticket-reason-editor-row { grid-template-columns: 1fr; }
  body.system-workspace-open .ticket-diagnostics-toolbar { align-items: stretch; flex-direction: column; }
  body.system-workspace-open .ticket-diagnostics-toolbar label { width: 100%; }
  body.system-workspace-open .ticket-diagnostic-row { grid-template-columns: 34px minmax(0, 1fr); }
  body.system-workspace-open .ticket-diagnostic-row > b { display: none; }
  body.system-workspace-open .ticket-diagnostic-row a { grid-column: 1 / -1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  body.system-workspace-open .ticket-motion-card { transition: none !important; transform: none !important; }
}

/* Ticket category and channel selectors. */
body.system-workspace-open .ticket-room-settings {
  display: grid;
  gap: 12px;
}

body.system-workspace-open .ticket-room-setting {
  padding: 16px 18px;
  border: 1px solid rgba(129,104,78, .2);
  border-radius: 15px;
  background: #1e1a14;
  transition: border-color .2s ease, box-shadow .2s ease;
}

body.system-workspace-open .ticket-room-setting:hover,
body.system-workspace-open .ticket-room-setting:focus-within {
  border-color: rgba(196, 165, 156, .62);
  box-shadow: 0 0 0 3px rgba(129,104,78, .08), 0 14px 32px rgba(0, 0, 0, .16);
}

body.system-workspace-open .ticket-room-setting > header {
  margin-bottom: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #f2ede4;
}

body.system-workspace-open .ticket-room-setting > header strong { font-size: 11px; }
body.system-workspace-open .ticket-room-setting > header svg { width: 17px; height: 17px; color: #c6b9a2; }

body.system-workspace-open .ticket-room-setting > div { position: relative; }
body.system-workspace-open .ticket-room-setting select {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  appearance: none;
  border: 1px solid #3d362b;
  border-radius: 11px;
  outline: 0;
  background: #15120e;
  color: #f2ede4;
  font: 700 11px Cairo, sans-serif;
  cursor: pointer;
}

body.system-workspace-open .ticket-room-setting select:focus { border-color: #a89a83; }
body.system-workspace-open .ticket-room-setting select option { background: #15120e; color: #f2ede4; }
body.system-workspace-open .ticket-room-setting > div > svg {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 15px;
  height: 15px;
  color: #a89a83;
  transform: translateY(-50%);
  pointer-events: none;
}

@media (max-width: 600px) {
  body.system-workspace-open .ticket-room-setting { padding: 14px; }
}
