:root {
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f4f6fb;
  --bg-elevated: rgba(255, 255, 255, 0.92);
  --surface: #ffffff;
  --surface-subtle: #f8f9fc;
  --surface-strong: #eef1f7;
  --surface-inverse: #10162f;
  --text: #172033;
  --text-strong: #0d1426;
  --muted: #667085;
  --muted-2: #8b95a7;
  --border: #e4e8f0;
  --border-strong: #d4dae6;
  --primary: #5955e7;
  --primary-strong: #4541cf;
  --primary-soft: #eeedff;
  --primary-ghost: rgba(89, 85, 231, 0.1);
  --teal: #0da892;
  --teal-soft: #e5f8f4;
  --success: #16865c;
  --success-soft: #e8f7ef;
  --warning: #b56d09;
  --warning-soft: #fff5dd;
  --danger: #c33b52;
  --danger-soft: #fff0f2;
  --info: #2774d8;
  --info-soft: #eaf3ff;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 4px 12px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 14px 32px rgba(16, 24, 40, 0.1), 0 2px 8px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.18), 0 4px 18px rgba(15, 23, 42, 0.08);
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --sidebar-width: 276px;
  --topbar-height: 72px;
  --content-max: 1640px;
}

html[data-theme="dark"] {
  --bg: #0c1020;
  --bg-elevated: rgba(15, 21, 40, 0.92);
  --surface: #131a2f;
  --surface-subtle: #171f37;
  --surface-strong: #202a45;
  --surface-inverse: #f7f8fc;
  --text: #e5e8f1;
  --text-strong: #ffffff;
  --muted: #9da6ba;
  --muted-2: #768198;
  --border: #26304b;
  --border-strong: #35405e;
  --primary: #8a84ff;
  --primary-strong: #a19dff;
  --primary-soft: #26234e;
  --primary-ghost: rgba(138, 132, 255, 0.14);
  --teal: #30cbb3;
  --teal-soft: #153b39;
  --success: #50cf98;
  --success-soft: #17392f;
  --warning: #f3b44f;
  --warning-soft: #3e3018;
  --danger: #ff8295;
  --danger-soft: #431f2a;
  --info: #73a9ff;
  --info-soft: #1c3152;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 16px 36px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:not(:disabled),
[role="button"]:not([aria-disabled="true"]) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2,
h3,
h4 {
  color: var(--text-strong);
  font-family: var(--font-display);
  letter-spacing: -0.025em;
}

p {
  line-height: 1.6;
}

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

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 48%, transparent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 12px;
  left: 12px;
  transform: translateY(-150%);
  padding: 10px 14px;
  color: #fff;
  background: #11182f;
  border-radius: 10px;
  transition: transform 160ms ease;
}

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

.noscript {
  margin: 24px;
  padding: 18px;
  color: #fff;
  background: #b42318;
  border-radius: 14px;
}

.app-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.boot-screen {
  display: grid;
  justify-items: center;
  gap: 18px;
  min-width: 260px;
}

.boot-copy {
  display: grid;
  gap: 5px;
  text-align: center;
}

.boot-copy strong {
  font-size: 20px;
  letter-spacing: -0.03em;
}

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

.boot-progress {
  width: 180px;
  height: 4px;
  overflow: hidden;
  background: var(--surface-strong);
  border-radius: 99px;
}

.boot-progress span {
  display: block;
  width: 46%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--teal));
  border-radius: inherit;
  animation: boot 1.1s ease-in-out infinite alternate;
}

@keyframes boot {
  from { transform: translateX(-90%); }
  to { transform: translateX(205%); }
}

.brand-mark {
  position: relative;
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  color: #fff;
  background: #10162f;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 18px rgba(16, 22, 47, 0.18);
}

.brand-mark::before {
  position: absolute;
  width: 28px;
  height: 28px;
  content: "";
  background: radial-gradient(circle, rgba(99, 102, 241, 0.5), transparent 68%);
  transform: translate(8px, -8px);
}

.brand-mark span {
  position: relative;
  z-index: 1;
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #a89cff 10%, #3fe0c4 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-mark--large {
  width: 64px;
  height: 64px;
  border-radius: 20px;
}

.brand-mark--large span {
  font-size: 30px;
}

.icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.icon--sm {
  width: 16px;
  height: 16px;
}

.icon--lg {
  width: 24px;
  height: 24px;
}

.icon--xl {
  width: 30px;
  height: 30px;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(620px, 1.35fr);
  background: var(--surface);
}

.login-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 14% 15%, rgba(94, 234, 212, 0.26), transparent 30%),
    radial-gradient(circle at 82% 72%, rgba(129, 140, 248, 0.32), transparent 34%),
    linear-gradient(150deg, #111936 0%, #202765 48%, #4c3fa4 100%);
}

.login-visual::before,
.login-visual::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.login-visual::before {
  width: 620px;
  height: 620px;
  top: -180px;
  right: -320px;
}

.login-visual::after {
  width: 420px;
  height: 420px;
  bottom: -190px;
  left: -180px;
}

.login-visual__inner {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(30px, 5vw, 64px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.login-brand small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.login-story {
  max-width: 580px;
  margin: auto 0;
  padding: 70px 0 50px;
}

.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 7px 11px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 740;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.login-story h1 {
  max-width: 650px;
  margin-bottom: 22px;
  color: #fff;
  font-size: clamp(40px, 5.2vw, 72px);
  line-height: 0.99;
  letter-spacing: -0.055em;
}

.login-story p {
  max-width: 550px;
  color: rgba(255, 255, 255, 0.68);
  font-size: clamp(15px, 1.4vw, 18px);
}

.login-proof {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 34px;
}

.login-proof__item {
  padding: 16px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  backdrop-filter: blur(16px);
}

.login-proof__item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 17px;
}

.login-proof__item span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  line-height: 1.4;
}

.login-security-note {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.login-main {
  min-height: 100vh;
  overflow-y: auto;
  background: var(--surface);
}

.login-main__inner {
  width: min(820px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 68px);
}

.login-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: clamp(40px, 6vw, 76px);
}

.login-header {
  margin-bottom: 30px;
}

.login-header h2 {
  margin-bottom: 9px;
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.045em;
}

.login-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.demo-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
  padding: 14px 15px;
  color: color-mix(in srgb, var(--primary) 72%, var(--text));
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.5;
}

.role-groups {
  display: grid;
  gap: 26px;
}

.role-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.role-group__header h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.role-group__header span {
  color: var(--muted-2);
  font-size: 11px;
}

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

.role-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 15px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-xs);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.role-card:hover {
  transform: translateY(-2px);
  background: var(--surface-subtle);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  box-shadow: var(--shadow-sm);
}

.role-card[aria-selected="true"] {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  box-shadow: 0 0 0 3px var(--primary-ghost);
}

.role-card__avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 13px;
  font-size: 11px;
  font-weight: 800;
}

.role-card__copy {
  min-width: 0;
}

.role-card__copy strong {
  display: block;
  overflow: hidden;
  margin-bottom: 4px;
  color: var(--text-strong);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-card__copy span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.role-card__arrow {
  color: var(--muted-2);
  transition: transform 160ms ease, color 160ms ease;
}

.role-card:hover .role-card__arrow {
  color: var(--primary);
  transform: translateX(2px);
}

.login-action {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px -8px -12px;
  padding: 16px 8px 12px;
  background: linear-gradient(to bottom, transparent, var(--surface) 30%);
}

.login-action .button {
  flex: 1;
}

.login-selected {
  min-width: 160px;
  color: var(--muted);
  font-size: 11px;
}

.login-selected strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text-strong);
  font-size: 12px;
}

/* Buttons and inputs */
.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow-xs);
  font-size: 12px;
  font-weight: 720;
  line-height: 1;
  transition: transform 130ms ease, background 130ms ease, border-color 130ms ease, box-shadow 130ms ease;
}

.button:hover:not(:disabled) {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: none;
}

.button--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #6d5de9);
  border-color: transparent;
  box-shadow: 0 7px 18px rgba(89, 85, 231, 0.24);
}

.button--primary:hover:not(:disabled) {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-strong), #5d50d5);
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(89, 85, 231, 0.28);
}

.button--danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 20%, var(--border));
}

.button--ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.button--ghost:hover:not(:disabled) {
  background: var(--surface-strong);
  border-color: transparent;
  box-shadow: none;
}

.button--soft {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: transparent;
  box-shadow: none;
}

.button--soft:hover:not(:disabled) {
  background: color-mix(in srgb, var(--primary-soft) 82%, var(--primary));
  border-color: transparent;
  box-shadow: none;
}

.button--sm {
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 11px;
}

.button--lg {
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 13px;
  font-size: 13px;
}

.icon-button {
  position: relative;
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.icon-button:hover {
  color: var(--text-strong);
  background: var(--surface-strong);
  border-color: var(--border);
}

.icon-button--bordered {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.icon-button__dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: #ef476f;
  border: 2px solid var(--surface);
  border-radius: 50%;
}

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

.field label {
  color: var(--text-strong);
  font-size: 11px;
  font-weight: 700;
}

.input,
.select,
.textarea {
  width: 100%;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.input,
.select {
  height: 42px;
  padding: 0 12px;
  font-size: 12px;
}

.textarea {
  min-height: 98px;
  padding: 12px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.55;
}

.input:focus,
.select:focus,
.textarea:focus {
  background: var(--surface-subtle);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ghost);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

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

/* App shell */
.app-shell {
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  position: fixed;
  z-index: 40;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: transform 220ms ease, width 220ms ease;
}

.sidebar__top {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}

.sidebar__brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.sidebar__brand-copy {
  min-width: 0;
}

.sidebar__brand-copy strong {
  display: block;
  color: var(--text-strong);
  font-size: 15px;
  letter-spacing: -0.03em;
}

.sidebar__brand-copy small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 8px;
  padding: 10px 11px;
  text-align: left;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 13px;
  transition: background 140ms ease, border-color 140ms ease;
}

.workspace-switcher:hover {
  background: var(--surface-strong);
  border-color: var(--border-strong);
}

.workspace-switcher__logo {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(135deg, #4e58d8, #16ad99);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
}

.workspace-switcher__copy {
  min-width: 0;
  flex: 1;
}

.workspace-switcher__copy strong,
.workspace-switcher__copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-switcher__copy strong {
  color: var(--text-strong);
  font-size: 11px;
}

.workspace-switcher__copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.sidebar__scroll {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px 10px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.nav-group {
  margin-top: 18px;
}

.nav-group:first-child {
  margin-top: 5px;
}

.nav-group__label {
  display: block;
  padding: 0 10px 7px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  width: 100%;
  display: flex;
  min-height: 39px;
  align-items: center;
  gap: 11px;
  margin: 2px 0;
  padding: 8px 10px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 620;
  transition: color 130ms ease, background 130ms ease;
}

.nav-item:hover {
  color: var(--text-strong);
  background: var(--surface-strong);
}

.nav-item[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 740;
}

.nav-item[aria-current="page"]::before {
  position: absolute;
  left: -10px;
  width: 3px;
  height: 20px;
  content: "";
  background: var(--primary);
  border-radius: 0 99px 99px 0;
}

.nav-item__label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-badge {
  display: inline-flex;
  min-width: 20px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 99px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.sidebar__footer {
  padding: 11px;
  border-top: 1px solid var(--border);
}

.sidebar-profile {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  transition: background 140ms ease;
}

.sidebar-profile:hover {
  background: var(--surface-strong);
}

.sidebar-profile__copy {
  min-width: 0;
  flex: 1;
}

.sidebar-profile__copy strong,
.sidebar-profile__copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-profile__copy strong {
  color: var(--text-strong);
  font-size: 11px;
}

.sidebar-profile__copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.app-main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  transition: margin-left 220ms ease;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 clamp(18px, 2.6vw, 38px);
  background: var(--bg-elevated);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.35);
}

.topbar__left,
.topbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar__left {
  min-width: 0;
  flex: 1;
}

.topbar__right {
  flex: 0 0 auto;
}

.mobile-menu-button {
  display: none;
}

.breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.breadcrumbs strong {
  overflow: hidden;
  color: var(--text-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-trigger {
  width: min(360px, 34vw);
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 0 10px;
  color: var(--muted);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow-xs);
  font-size: 11px;
}

.command-trigger span {
  flex: 1;
}

.keyboard-key {
  display: inline-flex;
  min-width: 25px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  color: var(--muted-2);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
}

.region-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 650;
}

.region-pill:hover {
  color: var(--text-strong);
  background: var(--surface-strong);
}

.app-content {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(22px, 3vw, 38px);
}

.page-enter {
  animation: page-in 220ms ease both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Core components */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-header__copy {
  min-width: 0;
}

.page-header__eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-header h1 {
  margin-bottom: 7px;
  font-size: clamp(26px, 2.8vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.page-header p {
  max-width: 740px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card--flat {
  box-shadow: none;
}

.card--soft {
  background: var(--surface-subtle);
}

.card--hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 88% 0%, rgba(96, 232, 214, 0.24), transparent 26%),
    radial-gradient(circle at 12% 100%, rgba(155, 141, 255, 0.22), transparent 34%),
    linear-gradient(135deg, #111936, #25265e 58%, #3a357e);
  border: 0;
  box-shadow: var(--shadow-md);
}

.card--hero h1,
.card--hero h2,
.card--hero h3 {
  color: #fff;
}

.card__header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px 12px;
}

.card__header-copy {
  min-width: 0;
}

.card__header h2,
.card__header h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.025em;
}

.card__header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.card__body {
  padding: 12px 18px 18px;
}

.card__footer {
  padding: 13px 18px 16px;
  border-top: 1px solid var(--border);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.metric-card {
  position: relative;
  min-width: 0;
  min-height: 138px;
  display: flex;
  flex-direction: column;
  padding: 17px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 17px;
  box-shadow: var(--shadow-xs);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.metric-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.metric-card__label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 670;
}

.metric-card__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 11px;
}

.metric-card__value {
  margin-top: 14px;
  color: var(--text-strong);
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 760;
  letter-spacing: -0.045em;
}

.metric-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
}

.metric-card__change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 750;
}

.metric-card__change[data-tone="positive"] { color: var(--success); }
.metric-card__change[data-tone="warning"] { color: var(--warning); }
.metric-card__change[data-tone="danger"] { color: var(--danger); }
.metric-card__change[data-tone="neutral"] { color: var(--muted); }

.metric-card__detail {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.55fr);
  gap: 30px;
  min-height: 230px;
  margin-bottom: 18px;
  padding: clamp(24px, 3vw, 38px);
}

.dashboard-hero__copy {
  position: relative;
  z-index: 1;
  align-self: center;
}

.dashboard-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px 10px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 780;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.dashboard-hero h1 {
  max-width: 820px;
  margin-bottom: 13px;
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.052em;
}

.dashboard-hero p {
  max-width: 720px;
  margin-bottom: 23px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.dashboard-hero__actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.dashboard-hero .button--primary {
  color: #171a35;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.dashboard-hero .button--primary:hover {
  color: #171a35;
  background: #f7f7ff;
}

.dashboard-hero .button--ghost {
  color: rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 255, 255, 0.16);
}

.dashboard-hero .button--ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.hero-orbit {
  position: relative;
  min-height: 170px;
  align-self: center;
}

.hero-orbit__ring {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.hero-orbit__ring::before,
.hero-orbit__ring::after {
  position: absolute;
  inset: 18px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: inherit;
}

.hero-orbit__ring::after {
  inset: 42px;
}

.hero-orbit__center {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 26px;
  box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.06), 0 20px 45px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, -50%) rotate(8deg);
  backdrop-filter: blur(12px);
}

.hero-orbit__center svg {
  width: 34px;
  height: 34px;
  color: #77ead8;
  transform: rotate(-8deg);
}

.hero-orbit__node {
  position: absolute;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  backdrop-filter: blur(8px);
}

.hero-orbit__node:nth-child(2) { top: 2%; left: 48%; }
.hero-orbit__node:nth-child(3) { top: 40%; right: 0; }
.hero-orbit__node:nth-child(4) { bottom: 1%; left: 48%; }
.hero-orbit__node:nth-child(5) { top: 40%; left: 0; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.72fr);
  gap: 16px;
}

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

.stack {
  display: grid;
  gap: 16px;
  align-content: start;
}

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

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

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

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.section-gap {
  margin-top: 18px;
}

.list {
  display: grid;
}

.list-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.list-item:first-child {
  padding-top: 2px;
}

.list-item:last-child {
  padding-bottom: 2px;
  border-bottom: 0;
}

.list-item__copy {
  min-width: 0;
  flex: 1;
}

.list-item__copy strong,
.list-item__copy span {
  display: block;
}

.list-item__copy strong {
  overflow: hidden;
  color: var(--text-strong);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item__copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.list-item__meta {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 9px;
  text-align: right;
}

.avatar {
  display: inline-grid;
  width: 35px;
  height: 35px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--border));
  border-radius: 11px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.avatar--sm {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  font-size: 8px;
}

.avatar--lg {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  font-size: 12px;
}

.avatar--round {
  border-radius: 50%;
}

.avatar-group {
  display: flex;
  padding-left: 6px;
}

.avatar-group .avatar {
  margin-left: -6px;
  border: 2px solid var(--surface);
}

.badge,
.status-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 780;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge--neutral,
.status-badge[data-tone="neutral"] {
  color: var(--muted);
  background: var(--surface-strong);
}

.badge--primary,
.status-badge[data-tone="primary"] {
  color: var(--primary);
  background: var(--primary-soft);
}

.badge--success,
.status-badge[data-tone="success"] {
  color: var(--success);
  background: var(--success-soft);
}

.badge--warning,
.status-badge[data-tone="warning"] {
  color: var(--warning);
  background: var(--warning-soft);
}

.badge--danger,
.status-badge[data-tone="danger"] {
  color: var(--danger);
  background: var(--danger-soft);
}

.badge--info,
.status-badge[data-tone="info"] {
  color: var(--info);
  background: var(--info-soft);
}

.dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  background: currentColor;
  border-radius: 50%;
}

.progress {
  position: relative;
  width: 100%;
  height: 7px;
  overflow: hidden;
  background: var(--surface-strong);
  border-radius: 99px;
}

.progress > span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--teal));
  border-radius: inherit;
  transition: width 500ms ease;
}

.progress--thin {
  height: 4px;
}

.progress--success > span {
  background: var(--success);
}

.progress--warning > span {
  background: var(--warning);
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 9px;
}

.progress-label span:first-child {
  color: var(--muted);
}

.progress-label strong {
  color: var(--text-strong);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.data-table th {
  padding: 10px 12px;
  color: var(--muted-2);
  background: var(--surface-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  min-height: 52px;
  padding: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 120ms ease;
}

.data-table tbody tr:hover {
  background: var(--surface-subtle);
}

.table-person {
  display: flex;
  align-items: center;
  gap: 9px;
}

.table-person__copy {
  min-width: 0;
}

.table-person__copy strong,
.table-person__copy span {
  display: block;
}

.table-person__copy strong {
  color: var(--text-strong);
  font-size: 10px;
}

.table-person__copy span {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 8px;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.toolbar__left,
.toolbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-field {
  position: relative;
  min-width: 220px;
}

.search-field .icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 11px;
  color: var(--muted-2);
  pointer-events: none;
  transform: translateY(-50%);
}

.search-field .input {
  padding-left: 35px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-strong);
  border-radius: 10px;
}

.segmented button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 720;
}

.segmented button[aria-pressed="true"] {
  color: var(--text-strong);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}

.tab {
  position: relative;
  min-height: 43px;
  flex: 0 0 auto;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 10px;
  font-weight: 680;
}

.tab[aria-selected="true"] {
  color: var(--primary);
}

.tab[aria-selected="true"]::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  content: "";
  background: var(--primary);
  border-radius: 99px 99px 0 0;
}

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

.quick-action {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 11px;
  padding: 12px;
  text-align: left;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 13px;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.quick-action:hover {
  transform: translateY(-1px);
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 24%, var(--border));
}

.quick-action__icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.quick-action strong,
.quick-action span {
  display: block;
}

.quick-action strong {
  color: var(--text-strong);
  font-size: 10px;
}

.quick-action span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.kpi-strip__item {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
}

.kpi-strip__item span,
.kpi-strip__item strong,
.kpi-strip__item small {
  display: block;
}

.kpi-strip__item span {
  color: var(--muted);
  font-size: 9px;
}

.kpi-strip__item strong {
  margin-top: 7px;
  color: var(--text-strong);
  font-size: 20px;
  letter-spacing: -0.04em;
}

.kpi-strip__item small {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 8px;
}

.chart-shell {
  position: relative;
  min-height: 220px;
}

.chart-shell svg {
  width: 100%;
  height: 220px;
  overflow: visible;
}

.chart-grid-line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.chart-line {
  stroke: var(--primary);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line--teal {
  stroke: var(--teal);
}

.chart-area {
  fill: url(#areaGradient);
}

.chart-dot {
  fill: var(--surface);
  stroke: var(--primary);
  stroke-width: 2;
}

.chart-labels {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-top: -5px;
  color: var(--muted-2);
  font-size: 8px;
  text-align: center;
}

.bar-chart {
  min-height: 210px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 10px;
  padding: 20px 8px 0;
}

.bar-chart__item {
  height: 180px;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.bar-chart__bar {
  position: relative;
  width: min(34px, 74%);
  height: var(--height, 50%);
  min-height: 8px;
  background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--teal)));
  border-radius: 7px 7px 3px 3px;
  transition: height 500ms ease;
}

.bar-chart__bar:hover::after {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  padding: 5px 7px;
  color: #fff;
  content: attr(data-value);
  background: #14192f;
  border-radius: 7px;
  font-size: 8px;
  transform: translateX(-50%);
}

.bar-chart__item span {
  color: var(--muted-2);
  font-size: 8px;
}

.donut {
  position: relative;
  width: 156px;
  height: 156px;
  margin: 10px auto 20px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0 31%, var(--teal) 31% 53%, #7c87a9 53% 67%, #e6a348 67% 79%, #d27099 79% 90%, var(--surface-strong) 90% 100%);
}

.donut::after {
  position: absolute;
  inset: 22px;
  content: "";
  background: var(--surface);
  border-radius: inherit;
}

.donut__center {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.donut__center strong {
  color: var(--text-strong);
  font-size: 22px;
  letter-spacing: -0.04em;
}

.donut__center span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

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

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
}

.legend-item__swatch {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--swatch, var(--primary));
  border-radius: 3px;
}

.legend-item strong {
  margin-left: auto;
  color: var(--text-strong);
}

.insight-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px;
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 15%, var(--border));
  border-radius: 15px;
}

.insight-card__icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--primary);
  background: var(--surface);
  border-radius: 11px;
  box-shadow: var(--shadow-xs);
}

.insight-card__copy {
  min-width: 0;
  flex: 1;
}

.insight-card__copy strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text-strong);
  font-size: 10px;
}

.insight-card__copy p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.timeline {
  display: grid;
}

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

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item:not(:last-child)::before {
  position: absolute;
  top: 21px;
  bottom: 0;
  left: 10px;
  width: 1px;
  content: "";
  background: var(--border);
}

.timeline-item__dot {
  position: relative;
  z-index: 1;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--muted-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
}

.timeline-item__dot[data-status="Complete"] {
  color: var(--success);
  background: var(--success-soft);
  border-color: transparent;
}

.timeline-item__dot[data-status="Current"] {
  color: #fff;
  background: var(--primary);
  border-color: transparent;
  box-shadow: 0 0 0 4px var(--primary-ghost);
}

.timeline-item__copy strong {
  display: block;
  color: var(--text-strong);
  font-size: 10px;
}

.timeline-item__copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.timeline-item__date {
  color: var(--muted-2);
  font-size: 8px;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pipeline-stage {
  min-width: 90px;
  padding: 14px 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 13px;
}

.pipeline-stage strong,
.pipeline-stage span {
  display: block;
}

.pipeline-stage strong {
  color: var(--text-strong);
  font-size: 20px;
  letter-spacing: -0.04em;
}

.pipeline-stage span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
}

.pipeline-stage__bar {
  height: 3px;
  margin-top: 11px;
  background: var(--surface-strong);
  border-radius: 99px;
}

.pipeline-stage__bar span {
  display: block;
  width: var(--width, 50%);
  height: 100%;
  margin: 0;
  background: var(--primary);
  border-radius: inherit;
}

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px;
}

.profile-hero__avatar {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary-soft), var(--teal-soft));
  border: 1px solid var(--border);
  border-radius: 23px;
  font-size: 20px;
  font-weight: 800;
}

.profile-hero__copy h2 {
  margin-bottom: 5px;
  font-size: 22px;
}

.profile-hero__copy p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.profile-meta {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.profile-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8px;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 30px;
  text-align: center;
}

.empty-state__icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 15px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 17px;
}

.empty-state h3 {
  margin-bottom: 7px;
  font-size: 16px;
}

.empty-state p {
  max-width: 430px;
  margin: 0 auto 17px;
  color: var(--muted);
  font-size: 10px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
}

.settings-nav {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 8px;
}

.settings-nav button {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 10px;
}

.settings-nav button[aria-selected="true"] {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 730;
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
  gap: 26px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

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

.setting-row__copy strong {
  display: block;
  color: var(--text-strong);
  font-size: 11px;
}

.setting-row__copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.toggle {
  position: relative;
  width: 38px;
  height: 22px;
  padding: 0;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}

.toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  content: "";
  background: var(--surface);
  border-radius: 50%;
  box-shadow: var(--shadow-xs);
  transition: transform 140ms ease;
}

.toggle[aria-checked="true"] {
  background: var(--primary);
  border-color: var(--primary);
}

.toggle[aria-checked="true"]::after {
  transform: translateX(16px);
}

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

.security-control {
  min-height: 126px;
  padding: 15px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.security-control__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.security-control__icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--success);
  background: var(--success-soft);
  border-radius: 10px;
}

.security-control strong {
  display: block;
  margin-top: 13px;
  color: var(--text-strong);
  font-size: 10px;
}

.security-control p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

/* Drawers, modal and command menu */
.overlay {
  position: fixed;
  z-index: 90;
  inset: 0;
  background: rgba(8, 13, 28, 0.42);
  opacity: 0;
  transition: opacity 170ms ease;
  backdrop-filter: blur(2px);
}

.overlay[data-open="true"] {
  opacity: 1;
}

.drawer {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(430px, 92vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(102%);
  transition: transform 220ms ease;
}

.drawer[data-open="true"] {
  transform: translateX(0);
}

.drawer__header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.drawer__header h2 {
  margin: 0;
  font-size: 16px;
}

.drawer__header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.drawer__body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

.drawer__footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.modal-layer {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 13, 28, 0.5);
  opacity: 0;
  transition: opacity 170ms ease;
  backdrop-filter: blur(4px);
}

.modal-layer[data-open="true"] {
  opacity: 1;
}

.modal {
  width: min(560px, 100%);
  max-height: min(760px, 92vh);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(0.985);
  transition: transform 180ms ease;
}

.modal-layer[data-open="true"] .modal {
  transform: translateY(0) scale(1);
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 14px;
}

.modal__header h2 {
  margin-bottom: 5px;
  font-size: 18px;
}

.modal__header p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.modal__body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px 20px 20px;
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
}

.command-layer {
  align-items: start;
  padding-top: min(14vh, 130px);
}

.command-menu {
  width: min(680px, 100%);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}

.command-menu__search {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
}

.command-menu__search input {
  min-width: 0;
  flex: 1;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  font-size: 14px;
}

.command-menu__results {
  max-height: 390px;
  overflow-y: auto;
  padding: 8px;
}

.command-section-label {
  padding: 9px 9px 5px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.command-result {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
}

.command-result:hover,
.command-result[aria-selected="true"] {
  background: var(--surface-strong);
}

.command-result__icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 9px;
}

.command-result__copy {
  min-width: 0;
  flex: 1;
}

.command-result__copy strong,
.command-result__copy span {
  display: block;
}

.command-result__copy strong {
  color: var(--text-strong);
  font-size: 10px;
}

.command-result__copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.command-menu__footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 15px;
  color: var(--muted-2);
  background: var(--surface-subtle);
  border-top: 1px solid var(--border);
  font-size: 8px;
}

.umi-launcher {
  position: fixed;
  z-index: 55;
  right: 24px;
  bottom: 24px;
  display: flex;
  height: 46px;
  align-items: center;
  gap: 9px;
  padding: 0 14px 0 11px;
  color: #fff;
  background: linear-gradient(135deg, #514bdd, #2b8faf);
  border: 0;
  border-radius: 15px;
  box-shadow: 0 14px 30px rgba(67, 68, 189, 0.3);
  font-size: 11px;
  font-weight: 760;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.umi-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(67, 68, 189, 0.36);
}

.umi-launcher__spark {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 9px;
}

.umi-panel .drawer__body {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.umi-context {
  padding: 13px 17px;
  color: var(--muted);
  background: var(--primary-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 15%, var(--border));
  font-size: 9px;
  line-height: 1.5;
}

.umi-thread {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

.umi-message {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.umi-message--user {
  justify-content: flex-end;
}

.umi-message__avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 9px;
}

.umi-message__bubble {
  max-width: 82%;
  padding: 11px 12px;
  color: var(--text);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 4px 13px 13px 13px;
  font-size: 10px;
  line-height: 1.55;
}

.umi-message--user .umi-message__bubble {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  border-radius: 13px 4px 13px 13px;
}

.umi-message__bubble strong {
  display: block;
  margin-bottom: 5px;
  color: inherit;
}

.umi-suggestions {
  display: flex;
  gap: 6px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.umi-suggestion {
  padding: 6px 8px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: 8px;
  font-size: 8px;
  font-weight: 700;
}

.umi-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 13px;
  border-top: 1px solid var(--border);
}

.umi-composer textarea {
  min-height: 42px;
  max-height: 110px;
  flex: 1;
  padding: 11px 12px;
  resize: none;
  color: var(--text);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  font-size: 10px;
  line-height: 1.4;
}

.umi-composer textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ghost);
}

.notification-item {
  display: flex;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item[data-unread="true"] .notification-item__icon::after {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--primary);
  border: 2px solid var(--surface);
  border-radius: 50%;
}

.notification-item__icon {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 11px;
}

.notification-item__copy {
  min-width: 0;
  flex: 1;
}

.notification-item__copy strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-strong);
  font-size: 10px;
}

.notification-item__copy p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.notification-item__copy span {
  display: block;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 8px;
}

.role-switch-list {
  display: grid;
  gap: 7px;
}

.role-switch-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  text-align: left;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.role-switch-item:hover,
.role-switch-item[aria-current="true"] {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
}

.role-switch-item__copy strong,
.role-switch-item__copy span {
  display: block;
}

.role-switch-item__copy strong {
  color: var(--text-strong);
  font-size: 10px;
}

.role-switch-item__copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(370px, calc(100vw - 40px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: auto;
  transform: translateY(8px);
  animation: toast-in 180ms ease forwards;
}

.toast[data-tone="success"] .toast__icon {
  color: var(--success);
  background: var(--success-soft);
}

.toast[data-tone="danger"] .toast__icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.toast__icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 9px;
}

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

.toast__copy strong {
  color: var(--text-strong);
  font-size: 10px;
}

.toast__copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.toast__close {
  padding: 2px;
  color: var(--muted-2);
  background: transparent;
  border: 0;
}

@keyframes toast-in {
  to { opacity: 1; transform: translateY(0); }
}

.skeleton {
  position: relative;
  overflow: hidden;
  color: transparent !important;
  background: var(--surface-strong) !important;
  border-radius: 7px;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.mobile-scrim {
  display: none;
}

/* Responsive */
@media (max-width: 1180px) {
  .login-page {
    grid-template-columns: minmax(320px, 0.72fr) minmax(560px, 1.28fr);
  }

  .dashboard-hero {
    grid-template-columns: minmax(0, 1fr) 220px;
  }

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

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

@media (max-width: 980px) {
  :root {
    --sidebar-width: 258px;
  }

  .login-page {
    display: block;
  }

  .login-visual {
    min-height: auto;
  }

  .login-visual__inner {
    min-height: 560px;
  }

  .login-story {
    padding-top: 100px;
  }

  .login-main {
    min-height: auto;
  }

  .dashboard-grid,
  .dashboard-grid--equal {
    grid-template-columns: 1fr;
  }

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

  .span-3 {
    grid-column: span 2;
  }

  .command-trigger {
    width: 42px;
    justify-content: center;
    padding: 0;
  }

  .command-trigger span,
  .command-trigger .keyboard-key {
    display: none;
  }
}

@media (max-width: 820px) {
  .sidebar {
    transform: translateX(-103%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar[data-open="true"] {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0;
  }

  .mobile-menu-button {
    display: inline-grid;
  }

  .mobile-scrim {
    position: fixed;
    z-index: 35;
    inset: 0;
    display: block;
    background: rgba(8, 13, 28, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .mobile-scrim[data-open="true"] {
    opacity: 1;
    pointer-events: auto;
  }

  .region-pill {
    display: none;
  }

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

  .hero-orbit {
    display: none;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    display: flex;
    overflow-x: auto;
  }

  .settings-nav button {
    flex: 0 0 auto;
  }
}

@media (max-width: 660px) {
  .login-visual__inner {
    min-height: 520px;
    padding: 28px 24px;
  }

  .login-story h1 {
    font-size: 42px;
  }

  .login-proof {
    grid-template-columns: 1fr;
  }

  .login-proof__item:nth-child(n + 3) {
    display: none;
  }

  .login-main__inner {
    padding: 34px 20px;
  }

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

  .login-action {
    align-items: stretch;
    flex-direction: column;
  }

  .login-selected {
    min-width: 0;
  }

  .topbar {
    padding: 0 13px;
  }

  .topbar__right .button--soft {
    width: 40px;
    padding: 0;
  }

  .topbar__right .button--soft span {
    display: none;
  }

  .app-content {
    padding: 18px 13px 88px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .button {
    flex: 1;
  }

  .dashboard-hero {
    min-height: 260px;
    padding: 24px 20px;
  }

  .dashboard-hero h1 {
    font-size: 32px;
  }

  .metric-grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .security-control-grid {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-3 {
    grid-column: auto;
  }

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

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

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

  .profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-hero > .page-actions {
    grid-column: 1 / -1;
  }

  .form-row,
  .setting-row {
    grid-template-columns: 1fr;
  }

  .setting-row {
    gap: 12px;
  }

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

  .toolbar__left,
  .toolbar__right,
  .search-field {
    width: 100%;
  }

  .toolbar__right .button,
  .toolbar__left .button {
    flex: 1;
  }

  .umi-launcher {
    right: 14px;
    bottom: 14px;
    width: 46px;
    justify-content: center;
    padding: 0;
    border-radius: 15px;
  }

  .umi-launcher > span:last-child {
    display: none;
  }

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

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

@media print {
  .sidebar,
  .topbar,
  .umi-launcher,
  .page-actions,
  .toast-region {
    display: none !important;
  }

  .app-main {
    margin-left: 0;
  }

  .app-content {
    max-width: none;
    padding: 0;
  }

  .card,
  .metric-card {
    break-inside: avoid;
    box-shadow: none;
  }
}

/* Working SaaS workflow extensions */
.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;
}

.muted { color: var(--text-muted); font-size: 0.84rem; }
.mono-wrap { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.form-stack { display: grid; gap: 18px; }
.auth-form { display: grid; gap: 18px; }
.auth-submit { width: 100%; justify-content: center; margin-top: 4px; }
.auth-note { margin: 0; color: var(--text-muted); font-size: 0.78rem; line-height: 1.6; text-align: center; }
.checkbox-row { display: flex; align-items: flex-start; gap: 11px; min-height: 42px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); color: var(--text); cursor: pointer; }
.checkbox-row input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.checkbox-row span { line-height: 1.45; }
.input-error { padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--danger) 9%, var(--surface)); color: var(--danger); font-size: 0.86rem; line-height: 1.5; }

.profile-summary { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-soft); }
.profile-summary .avatar { width: 50px; height: 50px; font-size: 1rem; }
.profile-summary > div { display: grid; gap: 4px; }
.profile-summary strong { font-size: 1rem; }
.profile-summary span { color: var(--text-muted); font-size: 0.84rem; }
.person-cell { display: inline-flex; align-items: center; gap: 10px; min-width: 190px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.person-cell > span:last-child { display: grid; gap: 2px; }
.person-cell small { color: var(--text-muted); font-size: 0.76rem; }
.list-item--button { width: 100%; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; transition: background 150ms ease, transform 150ms ease; }
.list-item--button:hover { background: var(--surface-soft); }
.list-item--button:active { transform: translateY(1px); }

.table-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.table-search { width: min(420px, 100%); margin: 0; }
.inline-actions { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.link-button { padding: 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 650; text-align: left; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.select--compact { width: auto; min-width: 126px; height: 38px; padding: 0 32px 0 10px; font-size: 0.78rem; }
.multi-select { min-height: 170px; padding: 8px; }
.multi-select option { padding: 8px 9px; border-radius: 7px; }

.notice { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); color: var(--text-secondary); line-height: 1.5; font-size: 0.84rem; }
.notice .icon { flex: 0 0 auto; margin-top: 1px; }
.notice--warning { border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); background: color-mix(in srgb, var(--warning) 8%, var(--surface)); }
.notice--warning .icon { color: var(--warning); }
.notice--info { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.notice--info .icon { color: var(--accent); }

.progress-row { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.progress-row strong { min-width: 38px; font-size: 0.78rem; text-align: right; }
.progress-track { position: relative; flex: 1; height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-strong); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--border); }
.detail-grid > div { min-width: 0; padding: 14px 16px; background: var(--surface); }
.detail-grid dt { margin-bottom: 5px; color: var(--text-muted); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.detail-grid dd { margin: 0; color: var(--text); font-size: 0.87rem; overflow-wrap: anywhere; }

.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.control-item { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); font-size: 0.83rem; }
.control-item .icon { color: var(--success); flex: 0 0 auto; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.plan-card { display: flex; flex-direction: column; gap: 18px; min-height: 410px; padding: 22px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-sm); }
.plan-card--active { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent), var(--shadow-md); }
.plan-card header { display: grid; gap: 9px; }
.plan-card h3 { margin: 0; font-size: 1.25rem; }
.plan-card p { margin: 0; color: var(--text-muted); line-height: 1.55; }
.plan-price { display: flex; align-items: baseline; gap: 7px; }
.plan-price strong { font-size: 1.75rem; letter-spacing: -0.04em; }
.plan-price span { color: var(--text-muted); font-size: 0.78rem; }
.plan-card ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.plan-card li { display: flex; align-items: flex-start; gap: 8px; color: var(--text-secondary); font-size: 0.84rem; }
.plan-card li .icon { color: var(--success); flex: 0 0 auto; }
.plan-card > .button { margin-top: auto; justify-content: center; }

.quick-create-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quick-create-card { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 2px 12px; align-items: center; min-height: 88px; padding: 15px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
.quick-create-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 42%, var(--border)); box-shadow: var(--shadow-sm); }
.quick-create-card > span { display: grid; place-items: center; grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.quick-create-card strong { align-self: end; font-size: 0.88rem; }
.quick-create-card small { align-self: start; color: var(--text-muted); font-size: 0.74rem; }

.copy-field { display: flex; gap: 10px; align-items: center; }
.copy-field .input { flex: 1; }
.ticket-summary { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; color: var(--text-muted); font-size: 0.8rem; }
.ticket-thread { display: grid; gap: 12px; }
.ticket-comment { padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-soft); }
.ticket-comment--internal { border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); background: color-mix(in srgb, var(--warning) 7%, var(--surface)); }
.ticket-comment header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.ticket-comment header span { color: var(--text-muted); font-size: 0.72rem; }
.ticket-comment p { margin: 0; color: var(--text-secondary); white-space: pre-wrap; line-height: 1.55; }

.drawer--wide { width: min(620px, calc(100vw - 20px)); }
.chat-shell { display: flex; flex-direction: column; min-height: calc(100vh - 160px); gap: 14px; }
.chat-policy { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--success) 7%, var(--surface)); color: var(--text-secondary); font-size: 0.78rem; }
.chat-policy .icon { color: var(--success); }
.chat-thread { display: flex; flex: 1; flex-direction: column; gap: 12px; overflow: auto; padding: 2px 2px 12px; }
.chat-message { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: flex-start; max-width: 92%; }
.chat-message--user { align-self: flex-end; grid-template-columns: minmax(0, 1fr) 34px; }
.chat-message--user .chat-message__avatar { grid-column: 2; grid-row: 1; background: var(--text); color: var(--surface); }
.chat-message--user > div { grid-column: 1; grid-row: 1; background: var(--accent); color: white; border-color: transparent; }
.chat-message__avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-size: 0.72rem; font-weight: 800; }
.chat-message > div { padding: 12px 14px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface-soft); }
.chat-message strong { display: block; margin-bottom: 5px; font-size: 0.77rem; }
.chat-message p { margin: 0; color: inherit; white-space: pre-wrap; line-height: 1.55; font-size: 0.84rem; }
.chat-composer { position: sticky; bottom: 0; display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-composer .button { justify-self: end; }

@media (max-width: 760px) {
  .table-toolbar, .copy-field { align-items: stretch; flex-direction: column; }
  .table-search { width: 100%; }
  .detail-grid, .control-grid, .quick-create-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .chat-message { max-width: 100%; }
  .select--compact { width: 100%; }
}
