:root {
  color-scheme: dark;
  --bg-0: #050a14;
  --bg-1: #08111f;
  --bg-2: #101b33;
  --bg-3: #162544;
  --surface: rgba(255, 255, 255, .105);
  --surface-hover: rgba(255, 255, 255, .155);
  --surface-strong: rgba(17, 30, 53, .9);
  --glass: rgba(255, 255, 255, .12);
  --glass-strong: rgba(255, 255, 255, .19);
  --stroke: rgba(255, 255, 255, .16);
  --stroke-strong: rgba(255, 255, 255, .28);
  --text: #f8fbff;
  --muted: rgba(234, 243, 255, .72);
  --soft: rgba(234, 243, 255, .52);
  --primary: #60a5fa;
  --primary-strong: #3b82f6;
  --primary-deep: #2563eb;
  --cyan: #38bdf8;
  --violet: #a78bfa;
  --pink: #f472b6;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #fb7185;
  --info-bg: rgba(96, 165, 250, .16);
  --success-bg: rgba(74, 222, 128, .15);
  --warning-bg: rgba(251, 191, 36, .15);
  --danger-bg: rgba(251, 113, 133, .16);
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, .18);
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sidebar-width: 278px;
  --topbar-height: 76px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --focus: 0 0 0 3px rgba(96, 165, 250, .44);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--bg-0);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(1100px 720px at 8% -5%, rgba(56, 189, 248, .16), transparent 58%),
    radial-gradient(900px 650px at 100% 20%, rgba(96, 165, 250, .2), transparent 52%),
    radial-gradient(900px 680px at 55% 118%, rgba(236, 72, 153, .1), transparent 48%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1) 52%, var(--bg-0));
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: #9bd2ff;
}

img {
  max-width: 100%;
}

svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

h1,
h2,
h3 {
  line-height: 1.16;
  letter-spacing: -.025em;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.72rem, 3vw, 2.45rem);
}

h2 {
  margin-bottom: 7px;
  font-size: clamp(1.28rem, 2.2vw, 1.65rem);
}

h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.svg-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 9999;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 10px;
  color: #08111f;
  background: #fff;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus) !important;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(18px);
  opacity: .48;
  animation: float 18s ease-in-out infinite;
  transform: translate3d(0, 0, 0);
}

.orb-one {
  width: 310px;
  height: 310px;
  left: -100px;
  top: 7%;
  background: rgba(59, 130, 246, .28);
}

.orb-two {
  width: 260px;
  height: 260px;
  right: -70px;
  top: 29%;
  background: rgba(14, 165, 233, .17);
  animation-delay: -6s;
}

.orb-three {
  width: 360px;
  height: 360px;
  left: 35%;
  bottom: -150px;
  background: rgba(236, 72, 153, .13);
  animation-delay: -11s;
}

@keyframes float {
  50% { transform: translate3d(0, -20px, 0) scale(1.045); }
}

.glass {
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255, 255, 255, .145), rgba(255, 255, 255, .075));
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
}

.app-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  border-width: 0 1px 0 0;
  border-radius: 0;
  box-shadow: 14px 0 50px rgba(0, 0, 0, .2);
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  min-height: var(--topbar-height);
  padding: 14px 20px;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(56, 189, 248, .45), rgba(79, 70, 229, .43));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
  font-size: 1.22rem;
  font-weight: 900;
  letter-spacing: -.05em;
}

.brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.1;
}

.brand-copy strong {
  letter-spacing: .09em;
}

.brand-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: .78rem;
}

.sidebar-close {
  display: none !important;
  margin-left: auto;
}

.main-nav {
  flex: 1;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav-label {
  margin: 16px 11px 7px;
  color: var(--soft);
  font-size: .69rem;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 47px;
  margin: 3px 0;
  padding: 9px 12px;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .07);
}

.nav-item.is-active {
  color: #fff;
  border-color: rgba(125, 211, 252, .2);
  background: linear-gradient(90deg, rgba(59, 130, 246, .28), rgba(56, 189, 248, .09));
}

.nav-item.is-active::before {
  position: absolute;
  content: "";
  left: -13px;
  width: 4px;
  height: 26px;
  border-radius: 0 5px 5px 0;
  background: #60a5fa;
  box-shadow: 0 0 18px rgba(96, 165, 250, .7);
}

.nav-item svg {
  flex: 0 0 auto;
}

.nav-item span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-create {
  margin: 9px 0;
  color: #fff;
  border-color: rgba(255, 255, 255, .2);
  background: linear-gradient(135deg, rgba(59, 130, 246, .65), rgba(37, 99, 235, .48));
}

.nav-create:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, .78), rgba(37, 99, 235, .62));
}

.nav-count {
  min-width: 22px !important;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  color: #bfdbfe;
  background: rgba(59, 130, 246, .22);
  font-size: .73rem;
  font-weight: 750;
  text-align: center;
}

.nav-count.danger {
  color: #fecdd3;
  background: var(--danger-bg);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, .09);
}

.privacy-status {
  display: flex;
  align-items: center;
  margin: 0 4px 11px;
  gap: 9px;
  color: var(--success);
  font-size: .74rem;
}

.privacy-status > div {
  display: grid;
}

.privacy-status span {
  color: var(--soft);
}

.profile-compact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  padding: 9px;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, .055);
  cursor: pointer;
  text-align: left;
}

.profile-compact:hover {
  border-color: var(--stroke);
  background: rgba(255, 255, 255, .09);
}

.profile-compact > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.profile-compact strong,
.profile-compact small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-compact strong {
  font-size: .84rem;
}

.profile-compact small {
  color: var(--soft);
  font-size: .72rem;
}

.avatar,
.top-avatar,
.mini-avatar,
.timeline-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: white;
  font-weight: 800;
}

.avatar {
  width: 38px;
  height: 38px;
  font-size: .78rem;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  min-height: var(--topbar-height);
  padding: 11px clamp(16px, 3vw, 38px);
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  background: rgba(8, 17, 31, .68);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  backdrop-filter: blur(22px) saturate(145%);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  padding: 0;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, .075);
  cursor: pointer;
}

.icon-button:hover {
  color: white;
  background: rgba(255, 255, 255, .13);
}

.mobile-menu {
  display: none;
}

.global-search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(600px, 55vw);
}

.global-search > svg {
  position: absolute;
  left: 15px;
  z-index: 1;
  color: var(--soft);
}

.global-search input {
  width: 100%;
  height: 46px;
  padding: 0 72px 0 45px;
  border: 1px solid var(--stroke);
  border-radius: 15px;
  outline: 0;
  color: var(--text);
  background: rgba(255, 255, 255, .075);
}

.global-search input::placeholder {
  color: var(--soft);
}

.global-search input:focus {
  border-color: rgba(96, 165, 250, .65);
  background: rgba(255, 255, 255, .11);
}

.global-search kbd {
  position: absolute;
  right: 11px;
  padding: 3px 7px;
  border: 1px solid var(--stroke);
  border-radius: 7px;
  color: var(--soft);
  background: rgba(0, 0, 0, .16);
  font-family: inherit;
  font-size: .68rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 8px;
}

.demo-chip {
  padding: 4px 8px;
  border: 1px solid rgba(251, 191, 36, .25);
  border-radius: 999px;
  color: #fde68a;
  background: rgba(251, 191, 36, .12);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.notification-button {
  position: relative;
}

.notification-button span {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border: 2px solid #15233b;
  border-radius: 50%;
  background: var(--danger);
}

.top-avatar {
  width: 43px;
  height: 43px;
  border: 0;
  cursor: pointer;
  font-size: .8rem;
}

.main-content {
  width: min(100%, 1540px);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 38px);
  padding-bottom: calc(48px + var(--safe-bottom));
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 20px;
}

.page-head p,
.section-head p {
  margin: 0;
  color: var(--muted);
}

.page-actions,
.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #93c5fd;
  font-size: .72rem;
  font-weight: 760;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  gap: 8px;
  border-radius: 13px;
  font-weight: 720;
  cursor: pointer;
  text-decoration: none;
}

.primary-button {
  border: 1px solid rgba(147, 197, 253, .5);
  color: white;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 10px 28px rgba(37, 99, 235, .25);
}

.primary-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid var(--stroke);
  color: var(--text);
  background: rgba(255, 255, 255, .08);
}

.secondary-button:hover {
  background: rgba(255, 255, 255, .14);
}

.secondary-button.compact {
  min-height: 40px;
  padding: 8px 12px;
  font-size: .82rem;
}

.danger-button {
  border: 1px solid rgba(251, 113, 133, .34);
  color: #fecdd3;
  background: var(--danger-bg);
}

.text-button {
  min-height: 36px;
  padding: 6px 8px;
  border: 0;
  color: #93c5fd;
  background: transparent;
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(270px, .7fr);
  align-items: center;
  min-height: 214px;
  margin-bottom: 22px;
  padding: clamp(23px, 4vw, 40px);
  gap: 30px;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.hero-panel::after {
  position: absolute;
  content: "";
  right: -70px;
  bottom: -140px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, .25), transparent 67%);
  pointer-events: none;
}

.hero-panel .hero-copy {
  position: relative;
  z-index: 1;
}

.hero-panel p {
  max-width: 62ch;
  margin-bottom: 20px;
  color: var(--muted);
}

.hero-quick {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.quick-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 64px;
  padding: 11px 13px;
  gap: 12px;
  border: 1px solid var(--stroke);
  border-radius: 17px;
  color: var(--text);
  background: rgba(255, 255, 255, .085);
  cursor: pointer;
  text-align: left;
}

.quick-link:hover {
  border-color: var(--stroke-strong);
  background: rgba(255, 255, 255, .13);
  transform: translateX(2px);
}

.quick-link > span:nth-child(2) {
  display: grid;
}

.quick-link small {
  color: var(--soft);
}

.icon-bubble,
.category-icon,
.metric-icon,
.empty-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .17);
  background: linear-gradient(135deg, rgba(59, 130, 246, .35), rgba(14, 165, 233, .16));
}

.icon-bubble {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  color: #bfdbfe;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
  gap: 14px;
}

.metric-card {
  display: grid;
  min-height: 132px;
  padding: 18px;
  gap: 8px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .065));
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.metric-top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: .8rem;
}

.metric-icon {
  width: 37px;
  height: 37px;
  border-radius: 12px;
}

.metric-card strong {
  font-size: 1.76rem;
  line-height: 1;
}

.metric-card small {
  color: var(--soft);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, .72fr);
  gap: 18px;
}

.panel {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .065));
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.panel-pad {
  padding: clamp(18px, 2.4vw, 26px);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 15px;
}

.section-head h2 {
  margin-bottom: 4px;
}

.ticket-list {
  display: grid;
  gap: 9px;
}

.ticket-card {
  border: 1px solid rgba(255, 255, 255, .105);
  border-radius: 17px;
  background: rgba(255, 255, 255, .055);
  overflow: hidden;
}

.ticket-card:hover {
  border-color: rgba(96, 165, 250, .38);
  background: rgba(255, 255, 255, .085);
}

.ticket-card-main {
  display: block;
  width: 100%;
  padding: 15px 16px;
  border: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.ticket-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  gap: 8px;
}

.ticket-number {
  color: #93c5fd;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .74rem;
}

.ticket-card h3 {
  margin-bottom: 4px;
  font-size: .97rem;
}

.ticket-summary {
  display: -webkit-box;
  margin-bottom: 9px;
  overflow: hidden;
  color: var(--muted);
  font-size: .84rem;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--soft);
  font-size: .75rem;
}

.ticket-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-pill,
.tag,
.priority-pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 25px;
  padding: 3px 9px;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 760;
  white-space: nowrap;
}

.status-pill::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.tone-info {
  color: #93c5fd;
  border-color: rgba(96, 165, 250, .22);
  background: var(--info-bg);
}

.tone-success {
  color: #86efac;
  border-color: rgba(74, 222, 128, .22);
  background: var(--success-bg);
}

.tone-warning {
  color: #fde68a;
  border-color: rgba(251, 191, 36, .22);
  background: var(--warning-bg);
}

.tone-danger {
  color: #fecdd3;
  border-color: rgba(251, 113, 133, .24);
  background: var(--danger-bg);
}

.tag {
  color: var(--muted);
  border-color: var(--stroke);
  background: rgba(255, 255, 255, .06);
}

.tips-list,
.activity-list,
.knowledge-list {
  display: grid;
  gap: 10px;
}

.tip-card,
.activity-row,
.knowledge-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  padding: 12px;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 15px;
  background: rgba(255, 255, 255, .045);
}

.tip-card {
  cursor: pointer;
}

.tip-card:hover,
.knowledge-row:hover {
  border-color: rgba(96, 165, 250, .32);
  background: rgba(255, 255, 255, .075);
}

.tip-card strong,
.tip-card small,
.knowledge-row strong,
.knowledge-row small {
  display: block;
}

.tip-card small,
.knowledge-row small,
.activity-row small {
  color: var(--soft);
}

.mini-progress {
  height: 5px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}

.mini-progress span {
  display: block;
  width: var(--progress, 50%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #38bdf8);
}

.mini-progress.is-danger span {
  background: linear-gradient(90deg, #f59e0b, #fb7185);
}

/* Ticket creation */
.ticket-create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  gap: 18px;
}

.ticket-form-panel {
  padding: clamp(18px, 3vw, 30px);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 28px;
  gap: 10px;
}

.step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--soft);
  font-size: .78rem;
  font-weight: 720;
}

.step:not(:last-child)::after {
  position: absolute;
  right: -7px;
  width: calc(100% - 118px);
  height: 1px;
  background: var(--stroke);
  content: "";
}

.step span {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid var(--stroke);
  border-radius: 50%;
  background: rgba(255, 255, 255, .055);
}

.step.is-active {
  color: white;
}

.step.is-active span,
.step.is-complete span {
  border-color: rgba(96, 165, 250, .6);
  background: #2563eb;
}

.step.is-complete {
  color: #93c5fd;
}

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

.category-card {
  position: relative;
  display: grid;
  align-content: start;
  min-height: 170px;
  padding: 17px;
  gap: 10px;
  border: 1px solid var(--stroke);
  border-radius: 19px;
  color: var(--text);
  background: rgba(255, 255, 255, .055);
  cursor: pointer;
  text-align: left;
}

.category-card:hover {
  border-color: var(--stroke-strong);
  background: rgba(255, 255, 255, .09);
  transform: translateY(-2px);
}

.category-card.is-selected {
  border-color: rgba(96, 165, 250, .72);
  background: linear-gradient(145deg, rgba(59, 130, 246, .22), rgba(255, 255, 255, .075));
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .22);
}

.category-card.is-selected::after {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: white;
  background: #3b82f6;
  content: "✓";
  font-size: .72rem;
  font-weight: 800;
}

.category-icon {
  width: 45px;
  height: 45px;
  border-radius: 15px;
}

.category-icon.violet { color: #ddd6fe; background: rgba(139, 92, 246, .2); }
.category-icon.cyan { color: #a5f3fc; background: rgba(6, 182, 212, .17); }
.category-icon.emerald { color: #a7f3d0; background: rgba(16, 185, 129, .17); }
.category-icon.amber { color: #fde68a; background: rgba(245, 158, 11, .17); }
.category-icon.pink { color: #fbcfe8; background: rgba(236, 72, 153, .16); }

.category-card strong {
  margin-top: 2px;
}

.category-card small {
  color: var(--muted);
  line-height: 1.4;
}

.form-stack {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 7px;
}

.field > label,
.field > legend {
  padding: 0;
  color: var(--text);
  font-size: .83rem;
  font-weight: 720;
}

.field .required {
  color: #fda4af;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 47px;
  padding: 10px 13px;
  border: 1px solid var(--stroke);
  border-radius: 13px;
  outline: none;
  color: var(--text);
  background: rgba(5, 10, 20, .34);
}

.field textarea {
  min-height: 108px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--soft);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(96, 165, 250, .65);
  box-shadow: var(--focus);
}

.field select option {
  color: #0b1426;
  background: white;
}

.field-help {
  color: var(--soft);
  font-size: .74rem;
}

fieldset.field {
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
}

.choice label {
  display: grid;
  min-height: 82px;
  padding: 11px;
  gap: 3px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255, 255, 255, .045);
  cursor: pointer;
}

.choice label small {
  color: var(--soft);
}

.choice input:checked + label {
  border-color: rgba(96, 165, 250, .65);
  background: var(--info-bg);
}

.choice input:focus-visible + label {
  box-shadow: var(--focus);
}

.user-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  padding: 13px;
  gap: 11px;
  border: 1px solid rgba(74, 222, 128, .21);
  border-radius: 15px;
  background: rgba(74, 222, 128, .07);
}

.user-preview > div {
  display: grid;
}

.user-preview small {
  color: var(--muted);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  gap: 12px;
}

.context-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 20px);
  padding: 20px;
}

.security-list {
  display: grid;
  margin: 16px 0 0;
  padding: 0;
  gap: 11px;
  list-style: none;
}

.security-list li {
  display: flex;
  gap: 9px;
  color: var(--muted);
  font-size: .82rem;
}

.security-list svg {
  flex: 0 0 auto;
  color: var(--success);
}

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

.access-card {
  padding: 18px;
  border: 1px solid var(--stroke);
  border-radius: 19px;
  background: rgba(255, 255, 255, .05);
}

.access-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 13px;
}

.access-card .meta-list {
  margin: 14px 0;
}

.inline-reveal {
  display: inline-flex;
  min-height: 28px;
  margin-left: 4px;
  padding: 2px 5px;
  font-size: .68rem;
  vertical-align: middle;
}

.security-hint,
.bootstrap-hint {
  display: flex;
  align-items: flex-start;
  padding: 11px 12px;
  gap: 8px;
  border: 1px solid rgba(96, 165, 250, .2);
  border-radius: 13px;
  color: var(--muted);
  background: var(--info-bg);
  font-size: .76rem;
}

.security-hint svg,
.bootstrap-hint svg {
  flex: 0 0 auto;
  color: #93c5fd;
}

.bootstrap-hint p {
  margin: 4px 0 0;
}

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

.portal-choice {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 82px;
  padding: 12px;
  gap: 10px;
  border: 1px solid var(--stroke);
  border-radius: 15px;
  background: rgba(255, 255, 255, .045);
  cursor: pointer;
}

.portal-choice input {
  position: absolute;
  opacity: 0;
}

.portal-choice:has(input:checked) {
  border-color: rgba(96, 165, 250, .65);
  background: var(--info-bg);
}

.portal-choice:has(input:focus-visible) {
  box-shadow: var(--focus);
}

.portal-choice > span:last-child {
  display: grid;
}

.portal-choice small {
  color: var(--soft);
}

.portal-field-section {
  padding: 16px;
  border: 1px solid var(--stroke);
  border-radius: 17px;
  background: rgba(255, 255, 255, .035);
}

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

.secret-entry {
  display: flex;
  align-items: stretch;
  gap: 7px;
}

.secret-entry input {
  min-width: 0;
  flex: 1 1 180px;
}

.password-strength {
  display: grid;
  grid-template-columns: minmax(70px, 180px) 1fr;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  font-size: .7rem;
}

.password-strength::before {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  content: "";
}

.password-strength > span {
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  width: 0;
  height: 5px;
  border-radius: 999px;
  background: var(--danger);
  transition: width .2s ease;
}

.password-strength > span[data-score="3"],
.password-strength > span[data-score="4"] {
  background: var(--success);
}

.blind-replacement {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.suggestion-box {
  margin-top: 17px;
  padding: 14px;
  border: 1px solid rgba(167, 139, 250, .22);
  border-radius: 16px;
  background: rgba(139, 92, 246, .08);
}

.suggestion-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #ddd6fe;
  font-weight: 750;
  font-size: .82rem;
}

.suggestion-box p {
  margin: 8px 0 11px;
  color: var(--muted);
  font-size: .78rem;
}

/* Rich editor and uploads */
.composer {
  border: 1px solid var(--stroke);
  border-radius: 17px;
  background: rgba(5, 10, 20, .25);
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  min-height: 47px;
  padding: 5px 7px;
  gap: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, .11);
  overflow-x: auto;
}

.editor-toolbar button,
.editor-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 35px;
  min-height: 35px;
  padding: 5px 8px;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.editor-toolbar button:hover,
.editor-file-button:hover,
.editor-toolbar button.is-active {
  color: white;
  border-color: var(--stroke);
  background: rgba(255, 255, 255, .09);
}

.editor-file-button input,
.file-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toolbar-divider {
  flex: 0 0 auto;
  width: 1px;
  height: 23px;
  margin: 0 3px;
  background: var(--stroke);
}

.editor-dropzone {
  position: relative;
}

.rich-editor {
  min-height: 180px;
  max-height: 460px;
  padding: 15px;
  outline: none;
  overflow-y: auto;
  color: var(--text);
  line-height: 1.58;
}

.rich-editor:empty::before {
  color: var(--soft);
  content: attr(data-placeholder);
  pointer-events: none;
}

.rich-editor blockquote {
  margin: 8px 0;
  padding-left: 12px;
  border-left: 3px solid #60a5fa;
  color: var(--muted);
}

.rich-editor figure {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin: 10px 6px 10px 0;
  padding: 7px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
}

.rich-editor figure img {
  display: block;
  max-width: min(100%, 420px);
  max-height: 320px;
  border-radius: 8px;
  object-fit: contain;
}

.rich-editor figure figcaption {
  margin-top: 5px;
  color: var(--soft);
  font-size: .75rem;
}

.drop-overlay {
  position: absolute;
  inset: 6px;
  z-index: 3;
  display: none;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 2px dashed #60a5fa;
  border-radius: 14px;
  color: #bfdbfe;
  background: rgba(15, 30, 55, .92);
  pointer-events: none;
}

.editor-dropzone.is-dragging .drop-overlay {
  display: grid;
}

.attachment-list {
  display: grid;
  padding: 0 10px;
  gap: 7px;
}

.attachment-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  padding: 8px;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
}

.attachment-thumb {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .07);
  object-fit: cover;
}

.attachment-info {
  min-width: 0;
}

.attachment-info strong,
.attachment-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-info strong {
  font-size: .79rem;
}

.attachment-info small {
  color: var(--soft);
  font-size: .7rem;
}

.upload-progress {
  width: min(180px, 100%);
  height: 4px;
  margin-top: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .09);
  overflow: hidden;
}

.upload-progress span {
  display: block;
  width: var(--upload-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: #60a5fa;
  transition: width .18s ease;
}

.attachment-actions {
  display: flex;
  gap: 4px;
}

.attachment-actions button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--soft);
  background: transparent;
  cursor: pointer;
}

.attachment-actions button:hover {
  color: white;
  border-color: var(--stroke);
  background: rgba(255, 255, 255, .07);
}

.attachment-item.is-error {
  border-color: rgba(251, 113, 133, .3);
}

.attachment-item.is-error .upload-progress span {
  background: var(--danger);
}

.editor-footer {
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: var(--soft);
  font-size: .69rem;
}

.composer > [data-sensitive-warning] {
  margin: 8px 10px;
}

.privacy-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.privacy-inline svg {
  width: 14px;
  height: 14px;
  color: var(--success);
}

/* ticket detail */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 18px;
}

.detail-main,
.detail-sidebar {
  display: grid;
  gap: 15px;
}

.ticket-hero {
  padding: clamp(18px, 2.8vw, 28px);
}

.detail-back {
  margin: -5px 0 13px -7px;
}

.ticket-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ticket-title-row h1 {
  font-size: clamp(1.38rem, 2.7vw, 2rem);
}

.ticket-facts {
  display: flex;
  flex-wrap: wrap;
  margin-top: 16px;
  gap: 9px;
}

.ticket-facts .tag {
  min-height: 30px;
}

.sla-card {
  padding: 14px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: rgba(255, 255, 255, .045);
}

.sla-card-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: .78rem;
}

.timeline {
  display: grid;
  padding: clamp(17px, 2.5vw, 25px);
  gap: 18px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
}

.timeline-item:not(:last-child)::before {
  position: absolute;
  top: 43px;
  bottom: -19px;
  left: 18px;
  width: 1px;
  background: rgba(255, 255, 255, .13);
  content: "";
}

.timeline-avatar {
  position: relative;
  z-index: 1;
  width: 37px;
  height: 37px;
  font-size: .7rem;
}

.timeline-item.internal .timeline-avatar {
  color: #3c225f;
  background: #c4b5fd;
}

.timeline-content {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 4px 16px 16px;
  background: rgba(255, 255, 255, .045);
}

.timeline-item.internal .timeline-content {
  border-color: rgba(167, 139, 250, .25);
  background: rgba(139, 92, 246, .09);
}

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  gap: 6px;
}

.timeline-head strong {
  font-size: .83rem;
}

.timeline-head time {
  color: var(--soft);
  font-size: .7rem;
}

.timeline-content p {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
}

.message-document > :last-child {
  margin-bottom: 0;
}

.message-document blockquote {
  margin: 8px 0;
  padding-left: 12px;
  border-left: 3px solid #60a5fa;
  color: var(--muted);
}

.message-document pre {
  max-width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .25);
  overflow-x: auto;
}

.message-image {
  max-width: min(100%, 620px);
  margin: 12px 0;
  padding: 7px;
  border: 1px solid var(--stroke);
  border-radius: 13px;
  background: rgba(255, 255, 255, .04);
}

.message-image img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 540px;
  border-radius: 9px;
  object-fit: contain;
}

.message-image figcaption {
  padding: 6px 3px 1px;
  color: var(--soft);
  font-size: .72rem;
}

.reply-panel {
  padding: clamp(16px, 2.5vw, 24px);
}

.reply-tabs {
  display: flex;
  width: max-content;
  max-width: 100%;
  margin-bottom: 13px;
  padding: 3px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(0, 0, 0, .13);
}

.reply-tabs button {
  min-height: 35px;
  padding: 6px 12px;
  border: 0;
  border-radius: 9px;
  color: var(--soft);
  background: transparent;
  cursor: pointer;
}

.reply-tabs button.is-active {
  color: white;
  background: rgba(59, 130, 246, .4);
}

.reply-tabs button[data-mode="internal"].is-active {
  color: #ede9fe;
  background: rgba(139, 92, 246, .35);
}

.reply-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 12px;
}

.confidential-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .78rem;
  cursor: pointer;
}

.confidential-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #3b82f6;
}

.meta-card {
  padding: 18px;
}

.meta-card h3 {
  margin-bottom: 13px;
}

.meta-list {
  display: grid;
  margin: 0;
  gap: 12px;
}

.meta-list > div {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 9px;
}

.meta-list dt {
  color: var(--soft);
  font-size: .74rem;
}

.meta-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: .78rem;
}

.ai-card {
  padding: 18px;
  border-color: rgba(167, 139, 250, .25);
  background: linear-gradient(145deg, rgba(139, 92, 246, .13), rgba(255, 255, 255, .055));
}

.ai-card h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #ddd6fe;
}

.ai-card p {
  color: var(--muted);
  font-size: .78rem;
}

/* list/workbench */
.filter-bar {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px;
  gap: 8px;
  border: 1px solid var(--stroke);
  border-radius: 17px;
  background: rgba(255, 255, 255, .06);
  overflow-x: auto;
}

.filter-search {
  position: relative;
  flex: 1 1 240px;
  min-width: 200px;
}

.filter-search svg {
  position: absolute;
  top: 11px;
  left: 11px;
  color: var(--soft);
}

.filter-search input,
.filter-bar select {
  height: 42px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  color: var(--text);
  background: rgba(5, 10, 20, .34);
}

.filter-search input {
  width: 100%;
  padding: 8px 10px 8px 39px;
}

.filter-bar select {
  min-width: 140px;
  padding: 7px 30px 7px 10px;
}

.filter-bar select option {
  color: #0b1426;
}

.segmented {
  display: flex;
  padding: 3px;
  border: 1px solid var(--stroke);
  border-radius: 11px;
  background: rgba(0, 0, 0, .13);
}

.segmented button {
  display: grid;
  place-items: center;
  width: 35px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--soft);
  background: transparent;
  cursor: pointer;
}

.segmented button.is-active {
  color: white;
  background: rgba(59, 130, 246, .38);
}

.ticket-table-wrap {
  border: 1px solid var(--stroke);
  border-radius: 20px;
  background: rgba(255, 255, 255, .055);
  overflow: hidden;
}

.ticket-table {
  width: 100%;
  border-collapse: collapse;
}

.ticket-table th,
.ticket-table td {
  padding: 12px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .075);
  text-align: left;
  vertical-align: middle;
}

.ticket-table th {
  color: var(--soft);
  background: rgba(255, 255, 255, .04);
  font-size: .7rem;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.ticket-table td {
  color: var(--muted);
  font-size: .8rem;
}

.ticket-table tbody tr {
  cursor: pointer;
}

.ticket-table tbody tr:hover {
  background: rgba(255, 255, 255, .055);
}

.table-title {
  display: grid;
}

.table-title strong {
  color: var(--text);
  font-size: .82rem;
}

.table-title small {
  color: var(--soft);
}

.bulk-bar {
  position: sticky;
  bottom: 18px;
  z-index: 5;
  display: none;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin: 14px auto 0;
  padding: 9px 11px;
  gap: 9px;
  border-radius: 15px;
}

.bulk-bar.is-visible {
  display: flex;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  padding-bottom: 12px;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.kanban-column {
  padding: 11px;
  border: 1px solid var(--stroke);
  border-radius: 19px;
  background: rgba(255, 255, 255, .045);
  scroll-snap-align: start;
}

.kanban-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 2px 3px;
  color: var(--muted);
  font-size: .79rem;
  font-weight: 750;
}

.kanban-head span {
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.kanban-items {
  display: grid;
  min-height: 100px;
  gap: 8px;
}

.kanban-card {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  background: rgba(12, 24, 43, .72);
  cursor: grab;
}

.kanban-card:hover {
  border-color: rgba(96, 165, 250, .34);
}

.kanban-card h3 {
  margin: 7px 0;
  font-size: .84rem;
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--soft);
  font-size: .68rem;
}

/* knowledge, assets, reports and admin */
.knowledge-hero {
  padding: clamp(22px, 4vw, 38px);
  text-align: center;
}

.knowledge-search {
  position: relative;
  width: min(650px, 100%);
  margin: 18px auto 0;
}

.knowledge-search svg {
  position: absolute;
  top: 15px;
  left: 16px;
  color: var(--soft);
}

.knowledge-search input {
  width: 100%;
  height: 52px;
  padding: 10px 14px 10px 48px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  outline: none;
  color: var(--text);
  background: rgba(5, 10, 20, .4);
}

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

.article-card {
  display: grid;
  grid-template-columns: auto 1fr;
  padding: 16px;
  gap: 12px;
  border: 1px solid var(--stroke);
  border-radius: 17px;
  color: var(--text);
  background: rgba(255, 255, 255, .05);
  cursor: pointer;
  text-align: left;
}

.article-card:hover {
  border-color: rgba(96, 165, 250, .38);
  background: rgba(255, 255, 255, .085);
}

.article-card p {
  margin: 5px 0 0;
  color: var(--soft);
  font-size: .74rem;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.asset-card {
  padding: 18px;
  border: 1px solid var(--stroke);
  border-radius: 19px;
  background: rgba(255, 255, 255, .055);
}

.asset-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 15px;
}

.asset-card h3 {
  margin-bottom: 3px;
}

.asset-card p {
  color: var(--muted);
  font-size: .79rem;
}

.asset-card-footer {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: var(--soft);
  font-size: .72rem;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
  gap: 12px;
}

.report-card {
  padding: 18px;
}

.report-card strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 1.8rem;
}

.report-card small {
  color: var(--soft);
}

.chart-panel {
  padding: 20px;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  height: 250px;
  padding: 20px 10px 0;
  gap: 8px;
  border-bottom: 1px solid var(--stroke);
}

.bar-chart div {
  position: relative;
  min-height: 8px;
  height: var(--height);
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.bar-chart div:hover::after {
  position: absolute;
  top: -28px;
  left: 50%;
  padding: 3px 6px;
  border-radius: 6px;
  color: #fff;
  background: #0b1426;
  content: attr(data-value);
  font-size: .7rem;
  transform: translateX(-50%);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.admin-card {
  display: grid;
  min-height: 180px;
  padding: 18px;
  gap: 10px;
  border: 1px solid var(--stroke);
  border-radius: 19px;
  background: rgba(255, 255, 255, .05);
  cursor: pointer;
}

.admin-card:hover {
  border-color: rgba(96, 165, 250, .37);
  background: rgba(255, 255, 255, .08);
}

.admin-card p {
  color: var(--muted);
  font-size: .79rem;
}

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

.auth-setup-card {
  align-content: start;
  display: grid;
  gap: 18px;
}

.auth-setup-card .section-head > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 10px;
}

.auth-setup-card .section-head h2,
.auth-setup-card .section-head p {
  grid-column: 2;
}

.auth-step {
  grid-row: 1 / span 2;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(96, 165, 250, .42);
  border-radius: 13px;
  color: #dbeafe;
  background: rgba(37, 99, 235, .2);
  font-weight: 800;
}

.auth-state-line,
.auth-invitation {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-invitation-list {
  display: grid;
  gap: 9px;
}

.auth-invitation {
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
}

.auth-invitation > div {
  display: grid;
  min-width: 180px;
  margin-right: auto;
  gap: 3px;
}

.auth-invitation small,
.muted-copy,
.field small {
  color: var(--muted);
  line-height: 1.45;
}

.auth-success {
  margin-bottom: 16px;
  border-color: rgba(52, 211, 153, .34);
  color: #bbf7d0;
  background: rgba(16, 185, 129, .1);
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #86efac;
  font-size: .74rem;
}

.system-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  content: "";
}

.incident-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 16px;
  gap: 14px;
  border: 1px solid var(--stroke);
  border-radius: 17px;
  background: rgba(255, 255, 255, .05);
}

.incident-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: #fde68a;
  background: var(--warning-bg);
}

.incident-card p {
  margin: 5px 0 0;
  color: var(--soft);
  font-size: .76rem;
}

.profile-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 26px;
  gap: 20px;
}

.profile-large {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 27px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  font-size: 1.65rem;
  font-weight: 850;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
}

.contact-row {
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 14px;
  background: rgba(255, 255, 255, .045);
}

.contact-row small,
.contact-row strong {
  display: block;
}

.contact-row small {
  color: var(--soft);
}

.empty-state {
  display: grid;
  place-items: center;
  padding: 55px 18px;
  text-align: center;
}

.empty-icon {
  width: 58px;
  height: 58px;
  margin-bottom: 13px;
  border-radius: 19px;
  color: #bfdbfe;
}

.empty-icon.warning {
  color: #fde68a;
  background: var(--warning-bg);
}

.empty-state p {
  max-width: 48ch;
  color: var(--muted);
}

/* Dialogs, camera and image editor */
dialog {
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
}

dialog::backdrop {
  background: rgba(2, 6, 14, .78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

body.has-dialog {
  overflow: hidden;
}

.media-dialog {
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
}

.dialog-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100dvh - 24px);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 13px 16px;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.dialog-header h2 {
  margin: 0;
}

.camera-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 340px;
  background: #02040a;
  overflow: hidden;
}

.camera-stage video {
  display: block;
  width: 100%;
  height: min(64vh, 540px);
  object-fit: cover;
}

.camera-stage video.is-mirrored {
  transform: scaleX(-1);
}

.camera-guide {
  position: absolute;
  inset: 12% 9%;
  border: 2px solid rgba(255, 255, 255, .72);
  border-radius: 22px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .12);
  pointer-events: none;
}

.camera-stage p {
  position: absolute;
  bottom: 14px;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 30px);
  margin: 0;
  padding: 7px 11px;
  border-radius: 999px;
  color: rgba(255, 255, 255, .88);
  background: rgba(0, 0, 0, .52);
  font-size: .74rem;
  text-align: center;
  transform: translateX(-50%);
}

.camera-permission {
  display: grid;
  min-height: 330px;
  place-items: center;
  align-content: center;
  padding: 24px;
  text-align: center;
}

.camera-permission p {
  color: var(--muted);
}

.camera-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 86px;
  padding: 10px 16px;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.camera-controls > :last-child {
  justify-self: end;
}

.shutter {
  display: grid;
  place-items: center;
  width: 65px;
  height: 65px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.shutter span {
  width: 49px;
  height: 49px;
  border-radius: 50%;
  background: #fff;
  transition: transform .12s ease;
}

.shutter:active span {
  transform: scale(.88);
}

.file-label {
  position: relative;
}

.image-dialog {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100dvh;
}

.image-editor-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #050a14;
}

.image-editor-shell > .dialog-header {
  border-radius: 0;
}

.image-canvas-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 10px;
  background:
    linear-gradient(45deg, #0e1727 25%, transparent 25%),
    linear-gradient(-45deg, #0e1727 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #0e1727 75%),
    linear-gradient(-45deg, transparent 75%, #0e1727 75%);
  background-color: #090f1b;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  overflow: hidden;
}

#imageEditorCanvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 3px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  touch-action: none;
}

.crop-selection {
  position: absolute;
  border: 2px solid #60a5fa;
  background: rgba(96, 165, 250, .11);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .42);
  pointer-events: none;
}

.image-tools {
  display: flex;
  min-height: 70px;
  padding: 7px 10px;
  gap: 5px;
  border-width: 1px 0;
  border-radius: 0;
  overflow-x: auto;
}

.image-tools button {
  display: grid;
  grid-template-rows: auto auto;
  place-items: center;
  flex: 0 0 78px;
  min-height: 54px;
  padding: 5px;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: .65rem;
}

.image-tools button:hover,
.image-tools button.is-active {
  color: white;
  border-color: var(--stroke);
  background: rgba(255, 255, 255, .09);
}

.tool-glyph {
  font-size: 1.15rem;
  line-height: 1;
}

.image-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(72px + var(--safe-bottom));
  padding: 10px 16px calc(10px + var(--safe-bottom));
  gap: 12px;
  border-width: 0;
  border-radius: 0;
}

.image-editor-footer p {
  margin: 0;
  color: var(--soft);
  font-size: .72rem;
}

.image-editor-footer > div {
  display: flex;
  gap: 9px;
}

.confirm-dialog {
  width: min(420px, calc(100vw - 28px));
}

.confirm-card {
  padding: 25px;
  border-radius: var(--radius-lg);
  text-align: center;
}

.confirm-card .empty-icon {
  margin-inline: auto;
}

.confirm-card p {
  color: var(--muted);
}

.confirm-card .button-row {
  justify-content: center;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: calc(18px + var(--safe-bottom));
  z-index: 200;
  display: grid;
  width: min(390px, calc(100vw - 28px));
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  padding: 12px 13px;
  gap: 10px;
  border: 1px solid var(--stroke);
  border-radius: 15px;
  background: rgba(13, 26, 47, .95);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  animation: toast-in .24s ease both;
}

.toast strong,
.toast small {
  display: block;
}

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

.toast > svg {
  color: var(--success);
}

.toast button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  color: var(--soft);
  background: transparent;
  cursor: pointer;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
}

.connection-banner {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 300;
  padding: 6px 12px;
  border-radius: 0 0 12px 12px;
  color: #3f2a02;
  background: #fde68a;
  box-shadow: var(--shadow-sm);
  font-size: .74rem;
  font-weight: 750;
  transform: translateX(-50%);
}

.connection-banner svg {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
}

.mobile-tabs {
  display: none;
}

.view-loading {
  display: grid;
  gap: 20px;
}

.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .13), rgba(255, 255, 255, .06));
  background-size: 240% 100%;
  animation: shimmer 1.2s linear infinite;
}

.skeleton-heading {
  width: min(430px, 70%);
  height: 44px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.skeleton-grid span {
  height: 150px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .07);
}

@keyframes shimmer {
  to { background-position: -240% 0; }
}

.noscript {
  position: fixed;
  inset: 20px;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 30px;
  border-radius: 20px;
  color: #fff;
  background: #101b33;
  text-align: center;
}

@media (max-width: 1180px) {
  .dashboard-grid,
  .report-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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

@media (max-width: 930px) {
  :root {
    --topbar-height: 68px;
  }

  .app-layout {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 310px);
    transform: translateX(-105%);
    transition: transform .25s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close,
  .mobile-menu {
    display: inline-grid !important;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, .52);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }

  .topbar {
    padding-top: calc(11px + var(--safe-top));
  }

  .global-search {
    width: min(540px, 100%);
  }

  .content-grid,
  .ticket-create-layout,
  .detail-layout,
  .auth-setup-grid {
    grid-template-columns: 1fr;
  }

  .context-panel,
  .detail-sidebar {
    position: static;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-quick {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  body {
    padding-bottom: calc(76px + var(--safe-bottom));
  }

  .topbar {
    gap: 9px;
  }

  .global-search {
    display: none;
  }

  .demo-chip {
    display: none;
  }

  .main-content {
    padding: 17px 13px calc(26px + var(--safe-bottom));
  }

  .page-head {
    display: block;
    margin-bottom: 18px;
  }

  .page-actions {
    margin-top: 13px;
  }

  .page-actions > * {
    flex: 1 1 auto;
  }

  .hero-panel {
    min-height: 0;
    padding: 23px 18px;
    border-radius: 23px;
  }

  .hero-quick {
    grid-template-columns: 1fr;
  }

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

  .metric-card,
  .report-card {
    min-height: 118px;
    padding: 14px;
  }

  .metric-card strong,
  .report-card strong {
    font-size: 1.45rem;
  }

  .panel {
    border-radius: 21px;
  }

  .section-head {
    align-items: center;
  }

  .category-grid,
  .asset-grid,
  .admin-grid,
  .article-grid,
  .access-grid,
  .portal-catalog-grid,
  .access-form-grid {
    grid-template-columns: 1fr;
  }

  .secret-entry {
    flex-wrap: wrap;
  }

  .secret-entry input {
    flex-basis: 100%;
  }

  .category-card {
    grid-template-columns: auto 1fr;
    min-height: 0;
    align-items: center;
  }

  .category-card small {
    grid-column: 2;
  }

  .step {
    justify-content: center;
  }

  .step > strong {
    display: none;
  }

  .step:not(:last-child)::after {
    right: -45%;
    width: 90%;
  }

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

  .choice label {
    min-height: 62px;
  }

  .form-actions {
    position: sticky;
    bottom: calc(70px + var(--safe-bottom));
    z-index: 6;
    margin: 24px -10px -10px;
    padding: 10px;
    border: 1px solid var(--stroke);
    border-radius: 15px;
    background: rgba(8, 17, 31, .9);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }

  .form-actions button {
    flex: 1;
  }

  .auth-invitation {
    align-items: stretch;
  }

  .auth-invitation > div,
  .auth-invitation > button {
    width: 100%;
  }

  .ticket-title-row {
    display: block;
  }

  .ticket-title-row .status-pill {
    margin-top: 7px;
  }

  .reply-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .reply-actions .primary-button {
    width: 100%;
  }

  .editor-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-label {
    display: none;
  }

  .ticket-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

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

  .ticket-table thead {
    display: none;
  }

  .ticket-table tr {
    position: relative;
    margin-bottom: 9px;
    padding: 13px 12px 11px 44px;
    border: 1px solid var(--stroke);
    border-radius: 15px;
    background: rgba(255, 255, 255, .055);
  }

  .ticket-table td {
    padding: 3px 0;
    border: 0;
  }

  .ticket-table td:first-child {
    position: absolute;
    top: 16px;
    left: 13px;
    width: auto;
  }

  .ticket-table td:nth-child(n+4) {
    display: inline-block;
    width: auto;
    margin-right: 10px;
  }

  .filter-bar select {
    min-width: 125px;
  }

  .profile-panel {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-large {
    margin-inline: auto;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .meta-list > div {
    grid-template-columns: 90px 1fr;
  }

  .mobile-tabs {
    position: fixed;
    right: 8px;
    bottom: calc(7px + var(--safe-bottom));
    left: 8px;
    z-index: 32;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 66px;
    padding: 5px;
    border-radius: 20px;
  }

  .mobile-tabs button {
    display: grid;
    grid-template-rows: 25px auto;
    place-items: center;
    min-width: 0;
    padding: 4px 2px;
    gap: 2px;
    border: 0;
    border-radius: 14px;
    color: var(--soft);
    background: transparent;
    cursor: pointer;
    font-size: .64rem;
  }

  .mobile-tabs button.is-active {
    color: #bfdbfe;
    background: rgba(59, 130, 246, .18);
  }

  .mobile-tabs .mobile-create {
    position: relative;
    color: white;
  }

  .mobile-tabs .mobile-create svg {
    width: 37px;
    height: 37px;
    margin-top: -22px;
    padding: 9px;
    border: 3px solid #122039;
    border-radius: 50%;
    background: #3b82f6;
    box-sizing: content-box;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .4);
  }

  .mini-avatar {
    width: 24px;
    height: 24px;
    font-size: .55rem;
  }

  .toast-region {
    right: 12px;
    bottom: calc(82px + var(--safe-bottom));
  }

  .media-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100dvh;
    margin: 0;
  }

  .dialog-shell {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .camera-stage {
    min-height: 0;
  }

  .camera-stage video {
    height: 100%;
  }

  .camera-guide {
    inset: 8% 7%;
  }

  .camera-controls {
    min-height: calc(90px + var(--safe-bottom));
    padding-bottom: calc(10px + var(--safe-bottom));
  }

  .camera-controls .secondary-button {
    padding: 7px;
    font-size: .7rem;
  }

  .image-editor-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .image-editor-footer p {
    display: none;
  }

  .image-editor-footer > div {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
  }

  .connection-banner {
    width: max-content;
    max-width: calc(100vw - 18px);
    text-align: center;
  }
}

@media (max-width: 400px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 105px;
  }

  .camera-controls {
    gap: 5px;
  }

  .shutter {
    width: 58px;
    height: 58px;
  }

  .shutter span {
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  .orb {
    display: none;
  }
}

@media (forced-colors: active) {
  .glass,
  .panel,
  .metric-card,
  .ticket-card,
  .category-card {
    border: 1px solid CanvasText;
  }

  .status-pill::before {
    forced-color-adjust: none;
  }
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass,
  .panel,
  .topbar,
  .metric-card {
    background: rgba(16, 27, 51, .96);
  }
}
