:root {
  /* Brand (Insphere Solutions orange, verified against inspheresolutions.com) */
  --primary-50: #fff4ec;
  --primary-100: #ffe5d1;
  --primary-200: #fec9a3;
  --primary-300: #fca66e;
  --primary-400: #f89a4c;
  --primary-500: #f58634;
  --primary-600: #dd6f1f;
  --primary-700: #b85817;
  --primary-800: #93450f;
  --primary-900: #5c2b09;
  --secondary-500: #636466;
  --accent-500: #752ae3;

  /* Neutrals (derived from #1B2D38) */
  --neutral-0: #ffffff;
  --neutral-50: #f7f8fa;
  --neutral-100: #eef0f3;
  --neutral-200: #e2e5ea;
  --neutral-300: #ccd1d9;
  --neutral-400: #9aa4b2;
  --neutral-500: #6b7684;
  --neutral-600: #4b5563;
  --neutral-700: #33404d;
  --neutral-800: #1f2e3a;
  --neutral-900: #1b2d38;

  /* Semantic (matched to qbms status colors) */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --info: #2563eb;
  --info-bg: #eaf1fd;
  --status-inactive: #94a3b8;
  --status-inactive-bg: rgba(148, 163, 184, 0.12);

  /* Aliases used across the app */
  --app-header-height: 64px;
  --app-sidebar-width: 232px;
  --app-sidebar-width-collapsed: 76px;
  --app-brand-color: var(--primary-500);
  --app-primary: var(--primary-500);
  --app-primary-dark: var(--primary-600);
  --app-neutral: var(--neutral-900);
  --app-bg: #f5f6f8;
  --app-border: var(--neutral-200);

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(27, 45, 56, 0.06);
  --shadow-md: 0 4px 12px rgba(27, 45, 56, 0.08);
  --shadow-lg: 0 12px 28px rgba(27, 45, 56, 0.12);

  /* Radius & spacing */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 10px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --font-sans: 'Public Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Manrope', var(--font-sans);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--app-bg);
  color: var(--app-neutral);
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--app-primary);
}

::selection {
  background: var(--primary-200);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-400);
}

/* ---------- App shell (exact port of the Users List artboard) ---------- */

.app-shell {
  display: flex;
  min-height: 100vh;
  background: #F5F6F8;
}

.app-sidebar {
  width: 248px;
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  background: #FFFFFF;
  border-right: 1px solid #E3E6EC;
}

.app-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 18px;
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16.5px;
  color: #161A22;
  border-bottom: 1px solid #EDEFF3;
}

.app-sidebar__brand span.mark {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--primary-500);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  flex: none;
}

.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  overflow-y: auto;
}

.app-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 12px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #545B6B;
  font-size: 13.3px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.app-sidebar__link .icon {
  width: 17px;
  height: 17px;
  flex: none;
  display: flex;
}

.app-sidebar__link .icon svg {
  width: 17px;
  height: 17px;
}

.app-sidebar__link:hover {
  background: #F5F6F8;
}

.app-sidebar__link.is-active {
  background: var(--primary-50);
  color: var(--primary-500);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-header {
  height: 64px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  background-color: #FFFFFF;
  border-bottom: 1px solid #E3E6EC;
}

.app-header__search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F5F6F8;
  border: 1px solid #E3E6EC;
  border-radius: 8px;
  padding: 8px 12px;
  width: 340px;
  color: #8A90A0;
}

.app-header__search svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.app-header__search input {
  border: 0;
  background: none;
  outline: none;
  font-size: 13px;
  color: #161A22;
  width: 100%;
  font-family: inherit;
}

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

.app-header__icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  color: #545B6B;
  background: transparent;
  cursor: pointer;
  position: relative;
  text-decoration: none;
}

.app-header__icon-btn svg {
  width: 18px;
  height: 18px;
}

.app-header__icon-btn i {
  font-size: 16px;
  line-height: 1;
}

.app-header__icon-btn:hover {
  background: #F5F6F8;
  border-color: #E3E6EC;
}

.app-header__icon-btn .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid #fff;
}

.app-header__user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  background: transparent;
  border: none;
  padding: 0;
}

.app-header__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #161A22;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex: none;
}

.app-header__username {
  color: #161A22;
  font-weight: 600;
  font-size: 13px;
}

.app-header__workspace {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border: 1px solid #E3E6EC;
  border-radius: 8px;
  background: #fff;
  color: #161A22;
  font-weight: 700;
  font-size: 12.8px;
  cursor: pointer;
  position: relative;
}

.app-header__workspace .ws-avatar {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--primary-500);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-content {
  padding: 22px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- Dropdown menus (vanilla JS toggled, no Bootstrap) ---------- */

.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #E3E6EC;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.14);
  padding: 6px;
  list-style: none;
  margin: 0;
  z-index: 40;
}

.dropdown.is-open .dropdown-menu {
  display: block;
}

.dropdown-header {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #8A90A0;
  margin: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: #161A22;
  text-decoration: none;
  cursor: pointer;
}

.dropdown-item:hover {
  background: #F5F6F8;
}

.dropdown-item.active {
  color: var(--primary-500);
  font-weight: 600;
}

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

.dropdown-divider {
  height: 1px;
  background: #EDEFF3;
  border: none;
  margin: 6px 2px;
}
