:root {
  --shadow-strong: 0 6px 16px rgba(15, 23, 42, 0.14), 0 20px 42px rgba(15, 23, 42, 0.18);
  --shadow-soft: 0 2px 6px rgba(15, 23, 42, 0.08), 0 10px 24px rgba(15, 23, 42, 0.1);
}

body {
  --panel-shadow: var(--shadow-strong);
  font-family: "Segoe UI", Arial, system-ui, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.topbar > span {
  cursor: pointer;
  opacity: 0.98;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
}

.topbar > span:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.topbar > span.active {
  opacity: 1;
  color: #f4f8ff;
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.30);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -1px 0 rgba(255,255,255,.18),
    0 4px 12px rgba(2,8,23,.14);
}

.topbar > span.active::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.topbar > span.active::before {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 1px;
  height: 50%;
  border-radius: 11px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0) 100%);
}

.avatar-container,
.direction-toggle,
.filters-btn,
.new-ticket-btn,
.back-btn,
.back-to-list,
.back-button {
  box-shadow: var(--shadow-soft);
}

.avatar-container {
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow:
    0 4px 12px rgba(15, 23, 42, 0.18),
    0 10px 24px rgba(15, 23, 42, 0.14);
}

.filter-sidebar .filter-item.active {
  position: relative;
  border: 1px solid transparent;
  border-color: #60a5fa;
  background: linear-gradient(180deg, rgba(214, 229, 247, 0.95) 0%, rgba(191, 214, 240, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(147, 197, 253, 0.34),
    0 8px 18px rgba(37, 99, 235, 0.20),
    0 2px 6px rgba(2, 8, 23, 0.10);
  backdrop-filter: blur(12px) saturate(145%);
  -webkit-backdrop-filter: blur(12px) saturate(145%);
}

.filter-sidebar .filter-item.active::before {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 1px;
  height: 48%;
  border-radius: 7px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74) 0%, rgba(255, 255, 255, 0) 100%);
}
.filter-sidebar .filter-item.active .filter-item-label {
  color: #1e3a8a;
  font-weight: 600;
}

.filter-sidebar .filter-item.active .filter-item-count {
  border: 1px solid rgba(147, 197, 253, 0.8);
  background: linear-gradient(180deg, #edf4ff 0%, #dbeafe 100%);
  color: #2563eb;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(30, 64, 175, 0.14);
}

.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  line-height: 1;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.back-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transform: translateY(0);
}

.back-button:hover {
  border-color: rgba(79, 134, 198, 0.7);
  box-shadow: 0 4px 14px rgba(79, 134, 198, 0.28), 0 12px 28px rgba(15, 23, 42, 0.18);
}

.filter-section,
.table-wrap,
.ticket-card,
.comments-section,
.reply-section,
.sidebar-card,
.users-table-wrapper,
.users-panel,
.users-sidebar,
.users-stats,
.stats-card,
.chart-card,
.stat-card,
.profile-sidebar,
.profile-content,
.settings-sidebar,
.settings-content,
.settings-card,
.content-card,
.main-card,
.panel,
.widget,
.kb-sidebar,
.kb-content,
.knowledge-base-main,
.structure-sidebar,
.structure-content {
  box-shadow: var(--shadow-strong);
}
.filters-modal .filter-option.active {
  border: 1px solid rgba(59, 130, 246, 0.45);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(219, 234, 254, 0.9) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 14px rgba(59, 130, 246, 0.22);
  color: #1d4ed8;
  font-weight: 700;
}
input, button, select, textarea { font-family: inherit; }

/* Exact filter preset: contrast active + calm background */
.filter-sidebar .filter-section {
  background: #f7f9fc;
  border: 1px solid #e6ebf2;
  border-radius: 10px;
}

.filter-sidebar .filter-item:hover {
  background: #eef4fc;
}

.filter-sidebar .filter-item-label {
  color: #7b8598;
  font-weight: 500;
}

.filter-sidebar .filter-item-count {
  background: #e6ebf1;
  color: #8b95a6;
}

.filter-sidebar .filter-item.active {
  border-color: #60a5fa;
  background:
    linear-gradient(180deg, rgba(147, 197, 253, 0.78) 0%, rgba(191, 219, 254, 0.50) 100%),
    rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(147, 197, 253, 0.45),
    0 10px 22px rgba(37, 99, 235, 0.24),
    0 3px 8px rgba(2, 8, 23, 0.14);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}

.filter-sidebar .filter-item.active::before {
  height: 52%;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0) 100%);
}

.filter-sidebar .filter-item.active .filter-item-label {
  color: #1e3a8a;
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.filter-sidebar .filter-item.active .filter-item-count {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(147, 197, 253, 0.72) 100%);
  color: #1d4ed8;
  border: 1px solid #60a5fa;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 3px 8px rgba(37, 99, 235, 0.22);
}
/* Motion polish: smooth menu/filter switching without jitter */
.topbar > span {
  transition:
    background-color .22s ease,
    border-color .22s ease,
    box-shadow .22s ease,
    opacity .22s ease,
    transform .22s cubic-bezier(.22,1,.36,1);
}

.topbar > span:hover {
  transform: translateY(-1px);
}

.topbar > span.active {
  transform: translateY(0);
}

.filter-sidebar .filter-item {
  will-change: background-color, border-color, box-shadow, color, transform;
  transform: translateZ(0);
  transition:
    background-color .22s ease,
    border-color .22s ease,
    box-shadow .22s ease,
    color .22s ease,
    transform .18s ease;
}

.filter-sidebar .filter-item:active {
  transform: translateY(1px);
}

.filter-sidebar .filter-item-count,
.filter-sidebar .filter-item-label,
.filters-modal .filter-option {
  transition: color .22s ease, background-color .22s ease, border-color .22s ease, box-shadow .22s ease, transform .18s ease;
}
/* Final ticket back button alignment */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  padding: 8px 14px;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 16px;
  text-decoration: none;
}

.back-button:hover {
  border-color: #4f86c6;
  color: #4f86c6;
}

.back-button svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  stroke: currentColor;
  transform: translateY(1px);
}


/* User name glass: same style as company brand */
.user-name-display > span:first-child {
  opacity: 1 !important;
  padding: 8px 16px !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,0.16) !important;
  border: 1px solid rgba(255,255,255,0.24) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.38),
    0 4px 12px rgba(15,23,42,0.16) !important;
  transition: background-color .22s ease, border-color .22s ease, box-shadow .22s ease !important;
}

.user-name-display > span:first-child:hover {
  opacity: 1 !important;
  background: rgba(255,255,255,0.18) !important;
  border-color: rgba(255,255,255,0.30) !important;
}

.user-name-display > span:first-child::before,
.user-name-display > span:first-child::after {
  content: none !important;
  display: none !important;
}



/* Topbar back item (without arrow icon) */
.topbar .topbar-back-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding-left: 16px !important;
  padding-right: 16px !important;
  gap: 0 !important;
}


