@font-face {
  font-display: swap;
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 400;
  src: url("../vendor/fonts/roboto-mono-latin-400-normal.32cb6e153275.woff2") format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 500;
  src: url("../vendor/fonts/roboto-mono-latin-500-normal.90489770e8fc.woff2") format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 600;
  src: url("../vendor/fonts/roboto-mono-latin-600-normal.014d27828260.woff2") format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 700;
  src: url("../vendor/fonts/roboto-mono-latin-700-normal.5900c2f9140f.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* Sahara palette: global color ramps */
  --color-primary-950: #1b0700;
  --color-primary-900: #351100;
  --color-primary-800: #5d2504;
  --color-primary-700: #8e3f0f;
  --color-primary-600: #a95019;
  --color-primary: #c2652a;
  --color-primary-400: #dd8045;
  --color-primary-300: #f19b68;
  --color-primary-200: #ffb68c;
  --color-primary-100: #ffd7c2;
  --color-primary-50: #fff0e8;

  --color-secondary-950: #14110f;
  --color-secondary-900: #2c2825;
  --color-secondary-800: #403b37;
  --color-secondary-700: #605850;
  --color-secondary: #78706a;
  --color-secondary-500: #928a83;
  --color-secondary-400: #aaa39c;
  --color-secondary-300: #c5beb6;
  --color-secondary-200: #d8d0c8;
  --color-secondary-100: #ebe4dc;
  --color-secondary-50: #f6efe7;

  --color-tertiary-950: #210405;
  --color-tertiary-900: #3e0b0d;
  --color-tertiary-800: #641a1d;
  --color-tertiary-700: #7a2b2e;
  --color-tertiary: #8c3c3c;
  --color-tertiary-500: #b35858;
  --color-tertiary-400: #cb7474;
  --color-tertiary-300: #e78f91;
  --color-tertiary-200: #ffb0b0;
  --color-tertiary-100: #ffd8d6;
  --color-tertiary-50: #fff1ef;

  --color-neutral-950: #14110e;
  --color-neutral-900: #2d2721;
  --color-neutral-800: #403931;
  --color-neutral-700: #605850;
  --color-neutral: #78706a;
  --color-neutral-500: #918982;
  --color-neutral-400: #aaa39c;
  --color-neutral-300: #c3bbb2;
  --color-neutral-200: #d9d0c7;
  --color-neutral-100: #ece5dd;
  --color-neutral-50: #faf5ee;

  --color-background: #faf5ee;
  --color-surface: #fffaf4;
  --color-surface-container-low: #f6efe7;
  --color-surface-container: #f0e7dd;
  --color-surface-container-high: #ebe0d6;
  --color-ink: #221914;
  --color-body: #4f443c;
  --color-muted: #78706a;
  --color-border: rgba(216, 208, 200, 0.72);
  --color-border-strong: #b8aca1;
  --color-surface-overlay: rgba(255, 250, 244, 0.92);
  --color-table-heading: rgba(246, 239, 231, 0.6);
  --color-primary-border: rgba(194, 101, 42, 0.32);
  --color-success-border: rgba(89, 111, 69, 0.44);
  --color-warning-border: rgba(155, 95, 18, 0.34);
  --color-warning-border-subtle: rgba(155, 95, 18, 0.24);
  --color-danger-border: rgba(159, 46, 46, 0.34);
  --color-info-border: rgba(120, 97, 65, 0.28);
  --color-focus: rgba(194, 101, 42, 0.24);
  --color-white: #fffaf4;

  --color-success: #596f45;
  --color-success-surface: #f2f6ed;
  --color-warning: #9b5f12;
  --color-warning-surface: #fff4df;
  --color-danger: #9f2e2e;
  --color-danger-surface: #fff0ed;
  --color-info: #786141;
  --color-info-surface: #f6efe7;

  /* Global typography */
  --font-mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-heading: var(--font-mono);
  --font-body: var(--font-mono);
  --font-label: var(--font-mono);

  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 14px;
  --text-base: 15px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 32px;
  --text-3xl: 44px;
  --page-heading-size: 32px;

  --leading-tight: 1.08;
  --leading-heading: 1.15;
  --leading-body: 1.58;

  /* Global spacing, radius, and elevation */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  --shadow-soft: 0 2px 16px rgba(58, 48, 42, 0.04);
  --shadow-hover: 0 10px 30px rgba(58, 48, 42, 0.08);

  --container-width: 1160px;
  --control-height: 40px;

  /* Compatibility aliases used across the existing app */
  --bg: var(--color-background);
  --surface: var(--color-surface);
  --ink: var(--color-ink);
  --muted: var(--color-muted);
  --line: var(--color-border);
  --accent: var(--color-primary-600);
  --accent-strong: var(--color-primary-700);
  --warning: var(--color-warning);
  --danger: var(--color-danger);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-7);
  background: var(--color-surface-overlay);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
}

.brand small {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--accent-strong);
}

.brand:hover {
  color: var(--ink);
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--color-body);
  font-size: var(--text-sm);
  font-weight: 700;
}

.nav form {
  margin: 0;
}

.role-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--color-primary-50);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.role-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--color-surface-container-low);
}

.role-switch-button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 5px;
  background: transparent;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.role-switch-button.active {
  background: var(--accent);
  color: var(--color-white);
}

.auth-topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-7);
  background: var(--color-surface-overlay);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.auth-login-shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.96), rgba(250, 245, 238, 0.98)),
    repeating-linear-gradient(90deg, rgba(216, 208, 200, 0.1) 0 1px, transparent 1px 92px);
}

.auth-login-shell .page {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  margin: 0;
}

.auth-login-shell .messages {
  position: relative;
  z-index: 2;
  width: min(448px, calc(100vw - 32px));
  margin: 22px auto -6px;
}

.login-canvas {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(28px, 7vw, 80px) 20px;
}

.login-canvas::before {
  content: "";
  position: absolute;
  inset: clamp(14px, 2vw, 28px);
  border: 1px solid rgba(216, 208, 200, 0.46);
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(255, 250, 244, 0.58), rgba(246, 239, 231, 0.22) 48%, rgba(255, 241, 239, 0.26)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(448px, 100%);
  display: grid;
  gap: 0;
  padding: clamp(30px, 4vw, 44px);
  border: 1px solid rgba(216, 208, 200, 0.66);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(255, 250, 244, 0.92)),
    var(--color-surface);
  box-shadow: 0 22px 58px rgba(58, 48, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.76);
  animation: loginCardEnter 360ms ease both;
}

.login-card-header {
  display: grid;
  gap: 12px;
}

.login-card-header h1 {
  font-size: var(--page-heading-size);
}

.login-card-header p:not(.eyebrow) {
  max-width: 340px;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-md);
  line-height: 1.65;
}

.login-actions {
  display: grid;
  gap: 12px;
  margin-top: 34px;
}

.login-provider-button {
  min-height: 56px;
  gap: 12px;
  margin: 0;
  border: 1px solid rgba(194, 101, 42, 0.24);
  background: linear-gradient(180deg, var(--color-primary), var(--color-primary-600));
  box-shadow: 0 14px 28px rgba(142, 63, 15, 0.14);
  font-size: var(--text-base);
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.login-provider-button:hover,
.login-provider-button:focus-visible {
  border-color: rgba(142, 63, 15, 0.34);
  background: var(--color-primary-600);
  box-shadow: 0 16px 30px rgba(142, 63, 15, 0.18);
  color: var(--color-white);
  transform: translateY(-1px);
}

.login-provider-button:active {
  transform: translateY(0);
}

.login-provider-mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.login-provider-mark.microsoft {
  grid-template-columns: repeat(2, 8px);
  grid-template-rows: repeat(2, 8px);
  gap: 2px;
}

.login-provider-mark.microsoft span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: currentColor;
}

.login-notice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0;
}

.login-notice svg {
  width: 20px;
  height: 20px;
}

.login-divider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 34px 0 24px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  background: rgba(216, 208, 200, 0.78);
}

.login-bypass-form {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  border: 0;
}

.login-field {
  display: grid;
  gap: 8px;
}

.login-field label {
  color: var(--color-secondary-700);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-bypass-form .text-input {
  min-height: 48px;
  padding: 0 16px;
  border-color: rgba(216, 208, 200, 0.84);
  border-radius: var(--radius-md);
  background: rgba(250, 245, 238, 0.76);
  box-shadow: inset 0 1px 2px rgba(58, 48, 42, 0.03);
}

.login-bypass-form .text-input:hover {
  border-color: rgba(194, 101, 42, 0.28);
}

.login-bypass-form .text-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus);
  outline: none;
}

.login-bypass-form .errorlist {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  color: var(--color-danger);
  font-size: var(--text-xs);
  font-weight: 760;
  list-style: none;
}

.login-bypass-form > .errorlist {
  padding: 10px 12px;
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-md);
  background: var(--color-danger-surface);
}

.login-bypass-button {
  display: inline-flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--color-primary-border);
  background: rgba(255, 250, 244, 0.78);
  color: var(--color-primary-700);
  box-shadow: none;
}

.login-bypass-button svg {
  width: 18px;
  height: 18px;
}

.login-bypass-button:hover,
.login-bypass-button:focus-visible {
  border-color: rgba(194, 101, 42, 0.48);
  background: var(--color-primary-50);
  color: var(--color-primary-800);
}

.login-card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 34px;
  color: rgba(120, 112, 106, 0.72);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.login-card-footer span + span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 10px 2px 0;
  border-radius: var(--radius-pill);
  background: rgba(120, 112, 106, 0.42);
}

@keyframes loginCardEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.top-navigation {
  position: sticky;
  top: 0;
  z-index: 44;
  margin-left: var(--layout-sidebar-offset, var(--sidebar-width));
  border-bottom: 1px solid rgba(216, 208, 200, 0.72);
  background: rgba(255, 250, 244, 0.9);
  box-shadow: 0 6px 24px rgba(58, 48, 42, 0.045);
  backdrop-filter: blur(12px);
  transition: margin 180ms ease;
}

.top-nav-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "actions profile";
  min-height: 72px;
  align-items: center;
  gap: var(--space-4);
  padding: 10px 26px;
}

.top-nav-mobile-brand {
  display: none;
}

.top-nav-actions {
  grid-area: actions;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  overflow-x: auto;
  padding: 4px;
  scrollbar-width: none;
}

.top-nav-actions::-webkit-scrollbar {
  display: none;
}

.top-nav-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.82);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(58, 48, 42, 0.035);
  font-size: var(--text-sm);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.top-nav-button:hover,
.top-nav-button:focus-visible {
  border-color: var(--color-primary-border);
  background: var(--color-primary-50);
  color: var(--color-primary-800);
  text-decoration: none;
}

.top-nav-button.primary {
  border-color: var(--color-primary-border);
  background: var(--color-primary-50);
  color: var(--color-primary-800);
}

.top-nav-button.primary:hover,
.top-nav-button.primary:focus-visible {
  background: var(--color-primary-100);
}

.top-nav-button.danger {
  border-color: var(--color-danger-border);
  background: var(--color-tertiary-50);
  color: var(--color-tertiary-800);
}

.top-nav-button.danger:hover,
.top-nav-button.danger:focus-visible {
  background: var(--color-tertiary-100);
}

.top-nav-button svg,
.profile-toggle svg,
.profile-menu-item svg {
  width: 18px;
  height: 18px;
  color: currentColor;
}

.profile-menu {
  position: relative;
  grid-area: profile;
}

.profile-toggle {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 16px;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  max-width: 260px;
  padding: 5px 9px;
  border: 1px solid rgba(216, 208, 200, 0.82);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.78);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(58, 48, 42, 0.035);
}

.profile-toggle:hover,
.profile-toggle:focus-visible,
.profile-menu.open .profile-toggle {
  border-color: var(--color-primary-border);
  background: var(--color-primary-50);
  color: var(--color-primary-800);
}

.profile-toggle-copy {
  display: grid;
  min-width: 0;
  text-align: left;
}

.profile-toggle-copy span,
.profile-summary strong {
  overflow: hidden;
  color: currentColor;
  font-size: var(--text-sm);
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-toggle-copy small,
.profile-summary small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 70;
  width: min(320px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(194, 101, 42, 0.2);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.98);
  box-shadow: 0 18px 44px rgba(58, 48, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.76);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
  visibility: hidden;
}

.profile-popover[hidden] {
  display: none;
}

.profile-menu.open .profile-popover {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.profile-summary {
  display: grid;
  gap: 3px;
  padding: 4px 4px 10px;
  border-bottom: 1px solid rgba(216, 208, 200, 0.76);
}

.profile-summary span {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-role-switcher {
  display: grid;
  gap: 6px;
  margin: 0;
}

.profile-role-button,
.profile-menu-item {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 800;
  text-align: left;
}

.profile-role-button:hover,
.profile-role-button:focus-visible,
.profile-menu-item:hover,
.profile-menu-item:focus-visible {
  border-color: var(--color-primary-border);
  background: var(--color-primary-50);
  color: var(--color-primary-800);
  text-decoration: none;
}

.profile-role-button.active {
  border-color: var(--color-primary-border);
  background: var(--color-primary-100);
  color: var(--color-primary-800);
}

.profile-menu-form {
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(216, 208, 200, 0.76);
}

.profile-menu-form .profile-menu-item {
  border-color: var(--color-danger-border);
  background: var(--color-tertiary-50);
  color: var(--color-tertiary-800);
}

.profile-menu-form .profile-menu-item:hover,
.profile-menu-form .profile-menu-item:focus-visible {
  border-color: rgba(159, 46, 46, 0.48);
  background: var(--color-tertiary-100);
  color: var(--color-tertiary-900);
}

.with-sidebar {
  --sidebar-width: 244px;
  --sidebar-collapsed-width: 68px;
  --layout-sidebar-offset: var(--sidebar-width);
  --page-gutter: clamp(18px, 2vw, 32px);
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 250, 244, 0.72), rgba(250, 245, 238, 0) 34%),
    var(--bg);
}

.nav-collapsed {
  --layout-sidebar-offset: var(--sidebar-collapsed-width);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-width);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--space-4);
  padding: 22px 16px 16px;
  background: rgba(255, 250, 244, 0.78);
  border-right: 1px solid rgba(216, 208, 200, 0.84);
  box-shadow: 2px 0 22px rgba(58, 48, 42, 0.035);
  backdrop-filter: blur(10px);
  transition: width 180ms ease, transform 180ms ease;
}

.sidebar-brand-row {
  position: relative;
  min-height: 38px;
  display: flex;
  align-items: center;
  padding-bottom: 16px;
}

.sidebar-brand-row::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(216, 208, 200, 0.08), rgba(194, 101, 42, 0.24), rgba(216, 208, 200, 0.08));
  box-shadow: 0 5px 12px rgba(58, 48, 42, 0.06);
}

.sidebar-brand {
  display: inline-flex;
  max-width: 100%;
  align-items: baseline;
  gap: 7px;
  color: var(--ink);
  white-space: nowrap;
}

.sidebar-brand:hover {
  color: var(--ink);
  text-decoration: none;
}

.brand-title {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 850;
  letter-spacing: 0;
  text-overflow: ellipsis;
}

.brand-title span {
  color: var(--color-primary-800);
  font-weight: 500;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding-top: var(--space-2);
  overflow-y: auto;
  scrollbar-width: thin;
}

.side-nav-link {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: #21140f;
  font-size: var(--text-sm);
  font-weight: 760;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.side-nav-link svg,
.sidebar-user svg,
.sidebar-signout svg,
.sidebar-toggle svg,
.mobile-nav-toggle svg {
  width: 20px;
  height: 20px;
  color: currentColor;
}

.side-nav-link:hover,
.side-nav-link:focus-visible {
  background: rgba(255, 240, 232, 0.78);
  border-color: var(--color-primary-border);
  color: var(--color-primary-800);
  text-decoration: none;
}

.side-nav-link.active {
  background: linear-gradient(180deg, rgba(255, 216, 194, 0.82), rgba(241, 155, 104, 0.22));
  border-color: rgba(194, 101, 42, 0.24);
  box-shadow: 0 8px 20px rgba(142, 63, 15, 0.08);
  color: var(--color-primary-800);
}

.side-nav-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-toggle,
.mobile-nav-toggle,
.nav-backdrop,
.sidebar-signout {
  appearance: none;
}

.sidebar-toggle {
  position: absolute;
  top: 50%;
  right: -20px;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(142, 63, 15, 0.2);
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 12px 28px rgba(142, 63, 15, 0.22);
  transform: translateY(-50%);
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  background: var(--color-primary-700);
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  margin: 0 -16px -16px;
  padding: 16px;
  border-top: 1px solid rgba(216, 208, 200, 0.84);
  background: rgba(255, 250, 244, 0.42);
}

.sidebar-user {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  min-height: 38px;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 780;
}

.sidebar-user svg {
  width: 32px;
  height: 32px;
  color: var(--color-primary-800);
}

.sidebar-logout-form {
  margin: 0;
}

.sidebar-version {
  display: inline-flex;
  width: 100%;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0;
  line-height: 1.2;
}

.sidebar-version strong {
  color: var(--color-primary-800);
  font-size: 11px;
  font-weight: 850;
}

.sidebar-signout {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: start;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-md);
  background: var(--color-tertiary-50);
  color: var(--color-tertiary-800);
  font-weight: 800;
}

.sidebar-signout span {
  justify-self: start;
}

.sidebar-signout:hover,
.sidebar-signout:focus-visible {
  border-color: rgba(159, 46, 46, 0.48);
  background: var(--color-tertiary-100);
  color: var(--color-tertiary-900);
}

.nav-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
  padding-inline: 14px;
}

.nav-collapsed .top-navigation {
  margin-left: var(--layout-sidebar-offset);
}

.nav-collapsed .sidebar-brand {
  width: 40px;
  min-height: 40px;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-primary-50);
  color: var(--color-primary-800);
}

.nav-collapsed .brand-title,
.nav-collapsed .side-nav-link span,
.nav-collapsed .sidebar-user span,
.nav-collapsed .sidebar-signout span,
.nav-collapsed .sidebar-version span {
  display: none;
}

.nav-collapsed .sidebar-brand::before {
  content: "PP";
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 850;
}

.nav-collapsed .side-nav-link {
  grid-template-columns: 1fr;
  width: 40px;
  min-height: 40px;
  justify-items: center;
  padding: 0;
}

.nav-collapsed .side-nav {
  overflow: visible;
}

.nav-collapsed .side-nav-link::before,
.nav-collapsed .side-nav-link::after {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
  visibility: hidden;
}

.nav-collapsed .side-nav-link::before {
  content: "";
  left: calc(100% + 8px);
  top: 50%;
  z-index: 6;
  width: 10px;
  height: 10px;
  border-bottom: 1px solid rgba(194, 101, 42, 0.2);
  border-left: 1px solid rgba(194, 101, 42, 0.2);
  background: rgba(255, 250, 244, 0.98);
  box-shadow: -2px 2px 8px rgba(58, 48, 42, 0.06);
  transform: translate(7px, -50%) rotate(45deg);
}

.nav-collapsed .side-nav-link::after {
  content: attr(data-nav-label);
  left: calc(100% + 14px);
  top: 50%;
  z-index: 5;
  min-height: 36px;
  max-width: min(220px, calc(100vw - 108px));
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  border: 1px solid rgba(194, 101, 42, 0.2);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.98);
  box-shadow: 0 14px 34px rgba(58, 48, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.76);
  color: var(--color-primary-800);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 780;
  letter-spacing: 0;
  line-height: 1.25;
  transform: translate(7px, -50%) scale(0.98);
  white-space: nowrap;
}

.nav-collapsed .side-nav-link:hover::before,
.nav-collapsed .side-nav-link:focus-visible::before,
.nav-collapsed .side-nav-link:hover::after,
.nav-collapsed .side-nav-link:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

.nav-collapsed .side-nav-link:hover::before,
.nav-collapsed .side-nav-link:focus-visible::before {
  transform: translate(0, -50%) rotate(45deg);
}

.nav-collapsed .side-nav-link:hover::after,
.nav-collapsed .side-nav-link:focus-visible::after {
  transform: translate(0, -50%) scale(1);
}

.enhanced-nav-tooltips.nav-collapsed .side-nav-link::before,
.enhanced-nav-tooltips.nav-collapsed .side-nav-link::after {
  display: none;
}

.enhanced-nav-tooltips.nav-collapsed .side-nav {
  overflow-x: hidden;
  overflow-y: auto;
}

.nav-tooltip {
  --tooltip-arrow-y: 50%;
  position: fixed;
  z-index: 100;
  min-height: 36px;
  max-width: min(240px, calc(100vw - 24px));
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  border: 1px solid rgba(194, 101, 42, 0.2);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.98);
  box-shadow: 0 14px 34px rgba(58, 48, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.76);
  color: var(--color-primary-800);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 780;
  letter-spacing: 0;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(7px, -50%, 0) scale(0.98);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
  visibility: hidden;
  white-space: nowrap;
}

.nav-tooltip::before {
  content: "";
  position: absolute;
  left: -6px;
  top: var(--tooltip-arrow-y);
  width: 10px;
  height: 10px;
  border-bottom: 1px solid rgba(194, 101, 42, 0.2);
  border-left: 1px solid rgba(194, 101, 42, 0.2);
  background: inherit;
  box-shadow: -2px 2px 8px rgba(58, 48, 42, 0.06);
  transform: translateY(-50%) rotate(45deg);
}

.nav-tooltip[data-placement="left"] {
  transform: translate3d(-7px, -50%, 0) scale(0.98);
}

.nav-tooltip[data-placement="left"]::before {
  right: -6px;
  left: auto;
  border: 0;
  border-top: 1px solid rgba(194, 101, 42, 0.2);
  border-right: 1px solid rgba(194, 101, 42, 0.2);
}

.nav-tooltip.visible {
  opacity: 1;
  transform: translate3d(0, -50%, 0) scale(1);
  visibility: visible;
}

.signout-confirmation {
  position: fixed;
  inset: 0;
  z-index: 1900;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
  visibility: hidden;
}

.signout-confirmation[hidden] {
  display: none;
}

.signout-confirmation.visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.signout-modal-open {
  overflow: hidden;
}

.signout-confirmation-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 250, 244, 0.52), rgba(34, 25, 20, 0.3)),
    rgba(34, 25, 20, 0.34);
  backdrop-filter: blur(6px);
}

.signout-confirmation-backdrop:hover,
.signout-confirmation-backdrop:focus,
.signout-confirmation-backdrop:focus-visible,
.signout-confirmation-backdrop:active {
  border: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 250, 244, 0.52), rgba(34, 25, 20, 0.3)),
    rgba(34, 25, 20, 0.34);
  color: transparent;
  outline: none;
  text-decoration: none;
}

.signout-dialog {
  position: relative;
  z-index: 1;
  width: min(430px, calc(100vw - 40px));
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid rgba(216, 208, 200, 0.82);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(255, 250, 244, 0.94)),
    var(--color-surface);
  box-shadow: 0 24px 62px rgba(58, 48, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.74);
  outline: none;
  transform: translateY(10px) scale(0.98);
  transition: transform 180ms ease;
}

.signout-confirmation.visible .signout-dialog {
  transform: translateY(0) scale(1);
}

.signout-dialog-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--color-danger-border);
  border-radius: 14px;
  background: var(--color-tertiary-50);
  color: var(--color-tertiary-800);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.signout-dialog-icon svg {
  width: 24px;
  height: 24px;
}

.signout-dialog-copy {
  display: grid;
  gap: 8px;
}

.signout-dialog-copy h2 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  line-height: var(--leading-heading);
}

.signout-dialog-copy p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.55;
}

.signout-dialog-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.signout-confirm-action,
.signout-cancel-action {
  min-height: 42px;
  border-radius: var(--radius-md);
  font-weight: 850;
}

.signout-confirm-action {
  gap: 9px;
  border: 1px solid rgba(159, 46, 46, 0.3);
  background: linear-gradient(180deg, var(--color-tertiary), var(--color-tertiary-700));
  color: var(--color-white);
  box-shadow: 0 12px 24px rgba(122, 43, 46, 0.16);
}

.signout-confirm-action svg {
  width: 18px;
  height: 18px;
}

.signout-confirm-action:hover,
.signout-confirm-action:focus-visible {
  border-color: rgba(159, 46, 46, 0.44);
  background: var(--color-tertiary-800);
  color: var(--color-white);
}

.release-notes-dialog {
  position: fixed;
  right: max(24px, env(safe-area-inset-right, 0px));
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  z-index: 1840;
  width: min(640px, calc(100vw - 40px));
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 16px, 0) scale(0.98);
  transition: opacity 210ms ease, transform 210ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.release-notes-dialog[hidden] {
  display: none;
}

.release-notes-dialog.visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.release-notes-panel {
  position: relative;
  display: grid;
  max-height: min(calc(100dvh - 48px), 720px);
  gap: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(216, 208, 200, 0.84);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.99), rgba(255, 250, 244, 0.95)),
    var(--color-surface);
  box-shadow: 0 24px 58px rgba(58, 48, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  pointer-events: auto;
}

.release-notes-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(216, 208, 200, 0.78);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.82);
  color: var(--color-muted);
  box-shadow: none;
  pointer-events: auto;
}

.release-notes-close:hover,
.release-notes-close:focus-visible {
  border-color: var(--color-primary-border);
  background: var(--color-primary-50);
  color: var(--color-primary-800);
}

.release-notes-close svg {
  width: 17px;
  height: 17px;
}

.release-notes-header {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding-right: 40px;
}

.release-notes-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(194, 101, 42, 0.28);
  border-radius: 14px;
  background: var(--color-primary-50);
  color: var(--color-primary-800);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.release-notes-icon svg {
  width: 24px;
  height: 24px;
}

.release-notes-header h2 {
  margin: 0;
  color: var(--color-ink);
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  line-height: var(--leading-heading);
}

.release-notes-header .eyebrow {
  margin-top: 6px;
}

.release-notes-summary {
  margin: 0;
  color: var(--color-body);
  font-size: var(--text-sm);
  font-weight: 650;
  line-height: 1.55;
}

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

.release-note-version-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(216, 208, 200, 0.78);
  border-radius: var(--radius-md);
  background: rgba(250, 245, 238, 0.72);
}

.release-note-version-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.release-note-version-header span {
  color: var(--color-primary-800);
  font-size: var(--text-md);
  font-weight: 900;
}

.release-note-version-header small {
  padding: 4px 8px;
  border: 1px solid rgba(194, 101, 42, 0.22);
  border-radius: 999px;
  background: var(--color-primary-50);
  color: var(--color-primary-800);
  font-size: var(--text-xs);
  font-weight: 800;
}

.release-note-version-card h3 {
  margin: 0;
  color: var(--color-ink);
  font-size: var(--text-base);
  font-weight: 850;
  line-height: 1.35;
}

.release-note-version-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.release-note-version-card li {
  position: relative;
  padding-left: 18px;
  color: var(--color-body);
  font-size: var(--text-sm);
  font-weight: 650;
  line-height: 1.45;
}

.release-note-version-card li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-primary-300);
  box-shadow: 0 0 0 3px rgba(194, 101, 42, 0.08);
}

.release-notes-actions {
  position: sticky;
  bottom: -22px;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  margin: 4px -22px -22px;
  padding: 14px 22px 22px;
  border-top: 1px solid rgba(216, 208, 200, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.76), rgba(255, 250, 244, 0.98) 34%),
    var(--color-surface);
}

.release-notes-primary {
  min-height: 40px;
  gap: 8px;
  padding-inline: 16px;
  border: 1px solid rgba(194, 101, 42, 0.34);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--color-primary), var(--color-primary-700));
  color: var(--color-white);
  font-weight: 850;
  box-shadow: 0 12px 24px rgba(194, 101, 42, 0.16);
  pointer-events: auto;
}

.release-notes-primary:hover,
.release-notes-primary:focus-visible {
  border-color: rgba(142, 63, 15, 0.42);
  background: var(--color-primary-800);
  color: var(--color-white);
}

.release-notes-primary svg {
  width: 17px;
  height: 17px;
}

.signout-confirm-action:disabled {
  cursor: progress;
  opacity: 0.72;
}

.signout-cancel-action {
  min-width: 104px;
  border: 1px solid var(--color-border);
  background: rgba(255, 250, 244, 0.76);
  color: var(--ink);
  box-shadow: none;
}

.signout-cancel-action:hover,
.signout-cancel-action:focus-visible {
  border-color: var(--color-primary-border);
  background: var(--color-primary-50);
  color: var(--color-primary-800);
}

.nav-collapsed .sidebar-footer {
  align-items: center;
  margin-inline: -14px;
  padding-inline: 14px;
}

.nav-collapsed .sidebar-version {
  width: 40px;
  justify-content: center;
}

.nav-collapsed .sidebar-user,
.nav-collapsed .sidebar-signout {
  grid-template-columns: 1fr;
  justify-items: center;
  width: 40px;
  padding: 0;
}

.mobile-nav-toggle,
.nav-backdrop {
  display: none;
}

/* Keep page sizing tied to shell variables so sidebar states stay globally aligned. */
.page {
  width: min(var(--container-width), calc(100vw - 32px));
  display: grid;
  gap: var(--space-6);
  align-content: start;
  margin: var(--space-8) auto;
}

.with-sidebar .page {
  width: auto;
  max-width: none;
  margin: var(--space-8) var(--page-gutter) var(--space-8) calc(var(--layout-sidebar-offset) + var(--page-gutter));
  transition: margin 180ms ease;
}

.nav-collapsed .page {
  margin-left: calc(var(--layout-sidebar-offset) + var(--page-gutter));
}

.role-select-shell {
  --layout-sidebar-offset: 0px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 250, 244, 0.9), rgba(250, 245, 238, 0) 46%),
    var(--bg);
}

.role-select-shell .top-navigation {
  margin-left: 0;
}

.role-select-shell .page {
  width: min(1180px, calc(100vw - 48px));
  max-width: 1180px;
  margin: var(--space-7) auto var(--space-8);
}

.role-select-shell .role-select-layout {
  min-height: calc(100vh - 210px);
  justify-content: center;
}

.section-header {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 4px 0 2px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--accent-strong);
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-family: var(--font-heading);
  font-size: var(--page-heading-size);
  font-weight: 700;
  line-height: var(--leading-tight);
}

h2 {
  font-family: var(--font-heading);
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 650;
  line-height: var(--leading-heading);
  margin-bottom: 0;
}

h3 {
  font-family: var(--font-body);
  font-size: var(--text-base);
  margin: 18px 0 10px;
  font-weight: 800;
}

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

.auth-layout {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
}

.auth-panel,
.panel,
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.auth-panel {
  width: min(440px, 100%);
  padding: var(--space-8);
}

.auth-version {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 800;
  text-align: center;
}

.error-layout {
  min-height: min(620px, calc(100vh - 180px));
  display: grid;
  place-items: center;
  padding: var(--space-8) 0;
}

.error-card {
  width: min(620px, 100%);
  display: grid;
  gap: var(--space-4);
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid rgba(194, 101, 42, 0.22);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.94), rgba(255, 250, 244, 0.82)),
    var(--surface);
  box-shadow: 0 24px 70px rgba(58, 48, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.error-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(194, 101, 42, 0.24);
  border-radius: var(--radius-lg);
  background: var(--color-primary-50);
  color: var(--color-primary-800);
}

.error-mark svg {
  width: 26px;
  height: 26px;
}

.error-card h1 {
  max-width: 12ch;
}

.error-message {
  max-width: 54ch;
  margin: 0;
  color: var(--color-body);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.55;
}

.error-reference {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-2) 0 0;
}

.error-reference div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(246, 239, 231, 0.58);
}

.error-reference dt {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.error-reference dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.primary-action,
button,
.button-link {
  display: inline-flex;
  min-height: var(--control-height);
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--color-white);
  font-family: var(--font-label);
  font-weight: 700;
  cursor: pointer;
}

.primary-action:hover,
button:hover,
.button-link:hover {
  background: var(--color-primary-700);
  text-decoration: none;
}

.button-link {
  margin: 0;
}

button.secondary {
  background: var(--color-surface-container-low);
  border: 1px solid var(--color-border-strong);
  color: var(--ink);
}

.secondary-link,
.danger-link {
  display: inline-flex;
  min-height: var(--control-height);
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.secondary-link:hover,
button.secondary:hover {
  background: var(--color-surface-container-low);
  text-decoration: none;
}

.danger-link {
  color: var(--color-white);
  border-color: var(--danger);
  background: var(--danger);
}

.danger-link:hover {
  background: var(--color-tertiary-800);
  text-decoration: none;
}

.secondary-link,
.danger-link,
.top-nav-button,
button,
.primary-action,
.button-link {
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 250, 244, 0.98), rgba(250, 245, 238, 0.82) 48%, rgba(250, 245, 238, 0.9)),
    rgba(250, 245, 238, 0.78);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
  visibility: hidden;
}

.app-loader[hidden] {
  display: none;
}

.app-loader.visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.app-loader-panel {
  position: relative;
  z-index: 1;
  width: min(360px, calc(100vw - 40px));
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 30px 28px;
  border: 1px solid rgba(194, 101, 42, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 244, 0.94);
  box-shadow: 0 24px 60px rgba(58, 48, 42, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.76);
  transform: translateY(8px) scale(0.98);
  transition: transform 180ms ease;
}

.app-loader.visible .app-loader-panel {
  transform: translateY(0) scale(1);
}

.app-loader-mark {
  position: relative;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
}

.app-loader-orbit {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(241, 155, 104, 0.2);
  border-top-color: var(--color-primary);
  border-right-color: rgba(194, 101, 42, 0.52);
  border-radius: var(--radius-pill);
  animation: appLoaderSpin 1.05s cubic-bezier(0.52, 0.12, 0.36, 0.88) infinite;
}

.app-loader-core {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-primary-700));
  color: var(--color-white);
  box-shadow: 0 14px 30px rgba(142, 63, 15, 0.2);
  font-size: var(--text-sm);
  font-weight: 900;
  letter-spacing: 0;
  animation: appLoaderPulse 2.4s ease-in-out infinite;
}

.app-loader-copy {
  display: grid;
  gap: 6px;
  text-align: center;
}

.app-loader-copy strong {
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  line-height: var(--leading-heading);
}

.app-loader-copy span {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 750;
  line-height: 1.4;
}

.app-loader-progress {
  width: min(220px, 100%);
  height: 4px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--color-surface-container-high);
}

.app-loader-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-300));
  animation: appLoaderProgress 1.2s ease-in-out infinite;
}

.app-loader-skeleton {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: min-content;
  gap: 18px;
  align-content: center;
  margin-left: var(--layout-sidebar-offset, 0);
  padding: clamp(28px, 6vw, 88px);
  opacity: 0.44;
}

.app-skeleton {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(216, 208, 200, 0.58);
  border-radius: var(--radius-md);
  background: rgba(235, 228, 220, 0.72);
}

.app-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 250, 244, 0.56) 45%, transparent 80%);
  animation: appSkeletonShimmer 1.65s ease-in-out infinite;
  transform: translateX(-100%);
}

.app-skeleton-title {
  grid-column: 2 / span 4;
  height: 52px;
}

.app-skeleton-line {
  grid-column: 2 / span 3;
  height: 22px;
}

.app-skeleton-panel {
  grid-column: 2 / span 9;
  height: 190px;
  margin-top: 28px;
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 244, 0.48);
}

.app-skeleton-card {
  grid-column: span 3;
  height: 170px;
  margin-top: 16px;
  background: rgba(255, 250, 244, 0.7);
}

.app-skeleton-card:nth-of-type(4) {
  grid-column: 2 / span 3;
}

.app-skeleton-card.muted {
  background: rgba(255, 241, 239, 0.58);
  border-color: rgba(231, 143, 145, 0.22);
}

.app-loader-active {
  cursor: progress;
}

[data-loader-locked="true"] {
  cursor: progress;
  opacity: 0.72;
  pointer-events: none;
}

form[data-loader-submitting="true"] {
  cursor: progress;
}

button[disabled],
input[type="submit"][disabled],
input[type="button"][disabled] {
  cursor: progress;
  opacity: 0.72;
}

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

@keyframes appLoaderPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes appLoaderProgress {
  0% {
    transform: translateX(-120%);
  }
  55% {
    transform: translateX(78%);
  }
  100% {
    transform: translateX(220%);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .app-loader,
  .app-loader-panel,
  .app-loader-orbit,
  .app-loader-core,
  .app-loader-progress span,
  .app-skeleton::after,
  .login-card,
  .signout-confirmation,
  .signout-dialog,
  .release-notes-dialog,
  .flash-notification,
  .flash-timer {
    animation: none;
    transition: none;
  }

  .flash-timer {
    display: none;
  }
}

.primary-action {
  width: 100%;
  margin: 18px 0 4px;
}

.notice,
.message {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-warning-surface);
  color: var(--warning);
  border: 1px solid var(--color-warning-border-subtle);
}

.flash-region {
  position: fixed;
  top: max(88px, calc(env(safe-area-inset-top, 0px) + 18px));
  right: max(24px, calc(env(safe-area-inset-right, 0px) + 18px));
  z-index: 1850;
  width: min(420px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
  pointer-events: none;
}

.auth-login-shell .flash-region {
  top: calc(env(safe-area-inset-top, 0px) + 22px);
}

.flash-notification {
  --flash-bg: rgba(255, 240, 232, 0.98);
  --flash-border: rgba(194, 101, 42, 0.38);
  --flash-accent: var(--color-primary);
  --flash-text: var(--color-primary-900);
  --flash-icon-bg: rgba(255, 216, 194, 0.44);
  --flash-duration: 5s;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 32px;
  gap: 12px;
  align-items: start;
  min-height: 76px;
  padding: 14px 12px 16px;
  border: 1px solid var(--flash-border);
  border-left-width: 5px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), transparent 58%),
    var(--flash-bg);
  box-shadow: 0 20px 46px rgba(58, 48, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  color: var(--flash-text);
  opacity: 0;
  pointer-events: auto;
  transform: translate3d(22px, -8px, 0) scale(0.98);
  transition: opacity 210ms ease, transform 210ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.flash-notification.success {
  --flash-bg: rgba(238, 248, 230, 0.98);
  --flash-border: rgba(89, 111, 69, 0.5);
  --flash-accent: var(--color-success);
  --flash-text: #314124;
  --flash-icon-bg: rgba(89, 111, 69, 0.12);
}

.flash-notification.warning {
  --flash-bg: rgba(255, 242, 213, 0.99);
  --flash-border: rgba(155, 95, 18, 0.5);
  --flash-accent: var(--color-warning);
  --flash-text: #5e3709;
  --flash-icon-bg: rgba(155, 95, 18, 0.12);
}

.flash-notification.error {
  --flash-bg: rgba(255, 237, 234, 0.99);
  --flash-border: rgba(159, 46, 46, 0.5);
  --flash-accent: var(--color-danger);
  --flash-text: #641a1d;
  --flash-icon-bg: rgba(159, 46, 46, 0.12);
}

.flash-notification.info {
  --flash-bg: rgba(255, 240, 232, 0.99);
  --flash-border: rgba(194, 101, 42, 0.5);
  --flash-accent: var(--color-primary);
  --flash-text: var(--color-primary-900);
  --flash-icon-bg: rgba(194, 101, 42, 0.13);
}

.flash-notification.visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.flash-notification.leaving {
  opacity: 0;
  transform: translate3d(22px, -8px, 0) scale(0.98);
}

.flash-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--flash-icon-bg);
  color: var(--flash-accent);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 244, 0.72);
}

.flash-icon svg {
  width: 21px;
  height: 21px;
}

.flash-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.flash-copy strong {
  color: var(--flash-text);
  font-size: var(--text-sm);
  font-weight: 800;
  line-height: 1.25;
}

.flash-copy span {
  color: var(--color-body);
  font-size: var(--text-sm);
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.flash-dismiss {
  width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--flash-text);
  opacity: 0.72;
  box-shadow: none;
}

.flash-dismiss svg {
  width: 17px;
  height: 17px;
}

.flash-dismiss:hover,
.flash-dismiss:focus-visible {
  border-color: var(--flash-border);
  background: rgba(255, 250, 244, 0.74);
  color: var(--flash-text);
  opacity: 1;
}

.flash-timer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--flash-accent);
  opacity: 0.78;
  transform-origin: left center;
  animation: flashTimer var(--flash-duration) linear forwards;
}

@keyframes flashTimer {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.qa-panel {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.two-column {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: var(--space-5);
}

.panel {
  display: grid;
  min-width: 0;
  gap: var(--space-4);
  padding: clamp(18px, 2vw, 26px);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.9), rgba(255, 250, 244, 0.76)),
    var(--surface);
  box-shadow: 0 8px 28px rgba(58, 48, 42, 0.045), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.panel.danger-panel {
  border-color: var(--color-danger-border);
  background:
    linear-gradient(180deg, rgba(255, 240, 237, 0.82), rgba(255, 250, 244, 0.82)),
    var(--surface);
}

.panel > h2,
.panel > .dashboard-section-heading,
.panel > .section-header {
  margin: 0;
}

.stacked-form,
.qa-panel {
  display: grid;
  gap: 14px;
}

.login-bypass-form.qa-panel {
  gap: 18px;
  margin: 0;
  padding: 0;
  border-top: 0;
}

label,
.field-group {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  color: var(--color-secondary-700);
}

.text-input,
input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="tel"],
input[type="url"],
select {
  width: 100%;
  min-height: var(--control-height);
  height: var(--control-height);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font: inherit;
  line-height: 1.2;
  background: rgba(255, 250, 244, 0.78);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(58, 48, 42, 0.03);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

textarea,
textarea.text-input {
  width: 100%;
  min-height: 112px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font: inherit;
  line-height: var(--leading-body);
  resize: vertical;
  background: rgba(255, 250, 244, 0.78);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(58, 48, 42, 0.03);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.text-input:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="text"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
input[type="search"]:hover,
input[type="tel"]:hover,
input[type="url"]:hover,
select:hover,
textarea:hover {
  border-color: rgba(194, 101, 42, 0.26);
  background: var(--color-surface);
}

.text-input:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px var(--color-focus);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-secondary-500);
}

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

.custom-dropdown-control,
.custom-combobox-control {
  position: relative;
  width: 100%;
  min-width: 0;
}

.custom-dropdown-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  width: 100%;
  min-height: var(--control-height);
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.84);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(58, 48, 42, 0.03);
  font: inherit;
  line-height: 1.2;
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.custom-dropdown-toggle:hover,
.custom-dropdown-control.open .custom-dropdown-toggle {
  border-color: rgba(194, 101, 42, 0.3);
  background: var(--color-surface);
}

.custom-dropdown-toggle:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus);
  outline: none;
}

.custom-dropdown-toggle:disabled {
  border-style: dashed;
  background: rgba(246, 239, 231, 0.76);
  color: var(--muted);
  cursor: not-allowed;
}

.custom-dropdown-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-dropdown-toggle[data-state="empty"] .custom-dropdown-summary {
  color: var(--color-secondary-500);
}

.custom-dropdown-toggle svg {
  width: 17px;
  height: 17px;
  color: var(--color-primary-700);
  transition: transform 160ms ease;
}

.custom-dropdown-control.open .custom-dropdown-toggle svg {
  transform: rotate(180deg);
}

.custom-dropdown-panel,
.custom-combobox-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  z-index: 80;
  display: grid;
  gap: 8px;
  inline-size: max(100%, min(22rem, calc(100vw - 32px)));
  max-inline-size: calc(100vw - 32px);
  padding: 8px;
  border: 1px solid rgba(194, 101, 42, 0.24);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.98);
  box-shadow: 0 18px 36px rgba(58, 48, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.custom-dropdown-control[data-align="end"] .custom-dropdown-panel,
.custom-combobox-control[data-align="end"] .custom-combobox-panel {
  right: 0;
  left: auto;
}

.custom-dropdown-search {
  min-height: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(216, 208, 200, 0.9);
  border-radius: var(--radius-sm);
  background: rgba(250, 245, 238, 0.72);
  color: var(--ink);
  font: inherit;
}

.custom-dropdown-search:focus {
  border-color: var(--color-primary);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px var(--color-focus);
  outline: none;
}

.custom-dropdown-list,
.custom-combobox-list {
  display: grid;
  gap: 6px;
  max-height: min(320px, 46vh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 3px 2px 2px;
  scrollbar-width: thin;
}

.custom-dropdown-option,
.custom-combobox-option {
  display: block;
  width: 100%;
  height: auto;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 800;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.custom-dropdown-option:hover,
.custom-dropdown-option.active,
.custom-combobox-option:hover,
.custom-combobox-option.active {
  border-color: var(--color-primary-border);
  background: var(--color-primary-50);
  color: var(--color-primary-800);
  box-shadow: inset 3px 0 0 rgba(194, 101, 42, 0.36);
}

.custom-dropdown-option[aria-selected="true"],
.custom-combobox-option[aria-selected="true"] {
  border-color: rgba(194, 101, 42, 0.34);
  background: rgba(255, 216, 194, 0.62);
  color: var(--color-primary-900);
  font-weight: 900;
  box-shadow: inset 3px 0 0 var(--color-primary-600);
}

.custom-dropdown-option[aria-selected="true"]::after,
.custom-combobox-option[aria-selected="true"]::after {
  content: "Selected";
  display: block;
  margin-top: 2px;
  color: var(--color-primary-700);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-transform: uppercase;
}

.custom-dropdown-option:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  box-shadow: none;
}

.custom-dropdown-group-label {
  margin: 6px 2px 2px;
  padding: 5px 8px 3px;
  border-top: 1px solid rgba(216, 208, 200, 0.74);
  color: var(--color-primary-800);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.custom-dropdown-empty {
  margin: 0;
  padding: 8px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 800;
  text-align: center;
}

.errorlist {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  color: var(--color-danger);
  font-size: var(--text-xs);
  font-weight: 780;
  list-style: none;
}

.stacked-form > .errorlist,
.field-group > .errorlist,
label > .errorlist {
  padding: 10px 12px;
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-md);
  background: var(--color-danger-surface);
}

.checkbox-list {
  display: grid;
  gap: 6px;
  padding: 0;
  list-style: none;
}

.role-choice-list {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.role-choice-list label {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.72);
}

.role-select-layout {
  min-height: calc(100vh - 220px);
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 520px);
  align-items: center;
  gap: clamp(28px, 5vw, 76px);
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(30px, 6vw, 78px) 0;
}

.role-select-intro {
  display: grid;
  align-content: center;
  gap: 16px;
}

.role-select-intro h1 {
  max-width: 520px;
}

.role-select-intro .muted {
  max-width: 470px;
  font-size: var(--text-lg);
}

.role-memory-banner {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-md);
  background: rgba(255, 240, 232, 0.72);
  color: var(--color-primary-800);
  box-shadow: var(--shadow-soft);
}

.role-memory-banner[hidden] {
  display: none;
}

.role-memory-banner > i,
.role-memory-banner > svg {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--color-primary-100);
  color: var(--color-primary-800);
}

.role-memory-banner div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.role-memory-banner strong {
  color: var(--color-primary-900);
  font-size: var(--text-sm);
  font-weight: 850;
}

.role-memory-banner span {
  color: var(--color-primary-800);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.35;
}

.role-memory-banner button {
  min-height: 34px;
  padding-inline: 12px;
  white-space: nowrap;
}

.role-select-card {
  display: grid;
  gap: 22px;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid rgba(216, 208, 200, 0.86);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.96), rgba(255, 250, 244, 0.9)),
    var(--surface);
  box-shadow: 0 18px 52px rgba(58, 48, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.role-select-card-header {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.role-select-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 14px;
  background: var(--color-primary-50);
  color: var(--color-primary-800);
  font-size: var(--text-sm);
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(194, 101, 42, 0.18);
}

.role-select-card-header h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  line-height: var(--leading-heading);
}

.role-select-card-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 750;
}

.role-select-label {
  color: var(--color-primary-800);
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.role-option-list {
  display: grid;
  gap: 12px;
}

.role-option-button {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  min-height: 76px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(246, 239, 231, 0.66);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.role-option-button:hover,
.role-option-button:focus-visible {
  border-color: var(--color-primary-border);
  background: var(--color-primary-50);
  box-shadow: 0 12px 26px rgba(142, 63, 15, 0.08);
  color: var(--color-primary-900);
  transform: translateY(-1px);
}

.role-option-button.active {
  border-color: rgba(194, 101, 42, 0.42);
  background: linear-gradient(180deg, rgba(255, 216, 194, 0.72), rgba(255, 240, 232, 0.82));
  color: var(--color-primary-900);
}

.role-option-button.remembered:not(.active) {
  border-color: var(--color-primary-border);
  background: rgba(255, 240, 232, 0.62);
}

.role-option-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.86);
  color: var(--color-primary-800);
  box-shadow: inset 0 0 0 1px rgba(216, 208, 200, 0.74);
}

.role-option-icon svg {
  width: 21px;
  height: 21px;
}

.role-option-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.role-option-copy strong {
  overflow: hidden;
  color: currentColor;
  font-size: var(--text-sm);
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-option-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.role-option-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-primary-800);
}

.role-option-meta small {
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 250, 244, 0.72);
  color: var(--color-primary-800);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.role-option-meta svg {
  width: 18px;
  height: 18px;
}

.role-preference-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.role-remember-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  font-size: var(--text-sm);
}

.role-remember-option input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--color-primary);
}

.role-remember-option span {
  display: grid;
  gap: 2px;
}

.role-remember-option strong {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 850;
  line-height: 1.3;
}

.role-remember-option small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.role-clear-preference {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-primary-800);
  font-size: var(--text-xs);
  font-weight: 850;
  white-space: nowrap;
}

.role-clear-preference:hover,
.role-clear-preference:focus-visible {
  background: transparent;
  color: var(--color-primary-900);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0;
}

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

.record-grid div {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(255, 250, 244, 0.72);
}

.record-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.record-grid strong {
  font-size: 24px;
}

.quick-link-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-3);
}

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

.quick-link-grid a,
.saved-view-list a {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.72);
  color: var(--color-primary-700);
  font-weight: 750;
  line-height: 1.25;
  padding: 8px 12px;
  text-align: center;
}

.quick-link-grid a:hover,
.saved-view-list a:hover {
  background: var(--color-primary-50);
  border-color: var(--color-primary-border);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

.admin-dashboard-stack {
  display: grid;
  gap: var(--space-5);
}

.admin-user-panel {
  gap: var(--space-5);
}

.admin-user-form {
  gap: var(--space-4);
}

.admin-user-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.admin-role-group {
  gap: 10px;
}

.admin-role-group .checkbox-list {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.admin-role-group .checkbox-list label {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.68);
}

.admin-user-form-actions {
  justify-content: flex-start;
}

.admin-user-form-actions button,
.admin-user-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.admin-user-form-actions svg,
.admin-user-action svg {
  width: 17px;
  height: 17px;
}

.admin-user-table td:last-child {
  min-width: 150px;
}

.status-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-weight: 850;
  line-height: 1;
}

.status-pill.active {
  border: 1px solid var(--color-success-border);
  background: var(--color-success-surface);
  color: var(--color-success);
}

.status-pill.inactive {
  border: 1px solid var(--color-danger-border);
  background: var(--color-danger-surface);
  color: var(--color-danger);
}

.admin-user-action {
  min-height: 38px;
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: var(--text-sm);
  font-weight: 850;
}

.admin-user-action.deactivate {
  border: 1px solid rgba(159, 46, 46, 0.3);
  background: var(--color-danger-surface);
  color: var(--color-danger);
}

.admin-user-action.deactivate:hover,
.admin-user-action.deactivate:focus-visible {
  background: var(--color-tertiary);
  color: var(--color-white);
}

.admin-user-action.activate {
  border: 1px solid var(--color-success-border);
  background: var(--color-success-surface);
  color: var(--color-success);
}

.admin-user-action.activate:hover,
.admin-user-action.activate:focus-visible {
  background: var(--color-success);
  color: var(--color-white);
}

.metric {
  position: relative;
  min-height: 126px;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: var(--space-5);
  background:
    linear-gradient(135deg, rgba(255, 250, 244, 0.92), rgba(246, 239, 231, 0.54)),
    var(--color-surface);
}

.metric::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 86px;
  height: 26px;
  border-bottom: 3px solid currentColor;
  border-radius: 50%;
  opacity: 0.16;
  transform: rotate(-6deg);
}

.metric-green {
  border-color: var(--color-success-border);
  background: linear-gradient(135deg, rgba(242, 246, 237, 0.94), rgba(255, 250, 244, 0.86));
  color: var(--color-success);
}

.metric-amber {
  border-color: var(--color-warning-border);
  background: linear-gradient(135deg, rgba(255, 244, 223, 0.94), rgba(255, 250, 244, 0.86));
  color: var(--color-warning);
}

.metric-red {
  border-color: var(--color-danger-border);
  background: linear-gradient(135deg, rgba(255, 240, 237, 0.94), rgba(255, 250, 244, 0.86));
  color: var(--color-danger);
}

.metric-blue {
  border-color: var(--color-info-border);
  background: linear-gradient(135deg, rgba(246, 239, 231, 0.94), rgba(255, 250, 244, 0.86));
  color: var(--color-info);
}

.metric-none {
  border-color: var(--color-border);
  color: var(--color-muted);
}

.metric span {
  display: block;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 850;
}

.metric strong {
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1;
}

.metric-green span,
.metric-green strong {
  color: var(--color-success);
}

.metric-amber span,
.metric-amber strong {
  color: var(--color-warning);
}

.metric-red span,
.metric-red strong {
  color: var(--color-danger);
}

.metric-blue span,
.metric-blue strong {
  color: var(--color-info);
}

.ui-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.82);
  box-shadow: var(--shadow-soft);
}

.ui-action-card {
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.ui-action-card:hover {
  border-color: var(--color-primary-border);
  background: rgba(255, 250, 244, 0.96);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

.ui-icon-box {
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: rgba(255, 240, 232, 0.72);
  box-shadow: inset 0 0 0 1px rgba(194, 101, 42, 0.14);
}

.ui-badge,
.ui-badge-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 250, 244, 0.72);
}

.ui-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 800;
}

.ui-progress-meter {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--color-surface-container);
}

.dashboard-home {
  display: grid;
  gap: var(--space-6);
}

.dashboard-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  align-items: stretch;
  padding: 6px 0 var(--space-2);
}

.dashboard-hero-copy {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
}

.dashboard-hero-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: var(--page-heading-size);
  line-height: 0.98;
}

.dashboard-hero-copy .muted {
  max-width: 620px;
  font-size: var(--text-lg);
}

.dashboard-section-heading span {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.dashboard-metric-card {
  position: relative;
  display: grid;
  min-height: 150px;
  align-content: start;
  gap: 8px;
  overflow: hidden;
  padding: var(--space-5);
  background: var(--color-surface);
}

.dashboard-metric-card::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 20px;
  width: 92px;
  height: 28px;
  border-bottom: 3px solid currentColor;
  border-radius: 50%;
  opacity: 0.24;
  transform: rotate(-6deg);
}

.dashboard-metric-card span {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 850;
}

.dashboard-metric-card strong {
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 38px;
  line-height: 1;
}

.dashboard-metric-card small {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 750;
}

.dashboard-metric-icon {
  width: 38px;
  height: 38px;
  background: rgba(255, 250, 244, 0.68);
  color: currentColor;
  box-shadow: inset 0 0 0 1px rgba(216, 208, 200, 0.5);
}

.dashboard-metric-icon svg {
  width: 19px;
  height: 19px;
}

.dashboard-metric-card.rag {
  color: var(--color-danger);
  background: linear-gradient(135deg, rgba(255, 216, 214, 0.62), rgba(255, 250, 244, 0.86));
}

.dashboard-metric-card.rag span,
.dashboard-metric-card.rag strong {
  color: currentColor;
}

.dashboard-metric-card.rag.metric-green {
  color: var(--color-success);
  background: linear-gradient(135deg, rgba(242, 246, 237, 0.92), rgba(255, 250, 244, 0.86));
}

.dashboard-metric-card.rag.metric-amber {
  color: var(--color-warning);
  background: linear-gradient(135deg, rgba(255, 244, 223, 0.92), rgba(255, 250, 244, 0.86));
}

.dashboard-metric-card.progress {
  color: #7d6f58;
  background: linear-gradient(135deg, rgba(255, 244, 223, 0.68), rgba(255, 250, 244, 0.9));
}

.dashboard-metric-card.alerts {
  color: #6170ad;
  background: linear-gradient(135deg, rgba(238, 238, 255, 0.74), rgba(255, 250, 244, 0.9));
}

.dashboard-metric-card.budget {
  color: #4f9a72;
  background: linear-gradient(135deg, rgba(225, 247, 235, 0.76), rgba(255, 250, 244, 0.9));
}

.dashboard-section {
  display: grid;
  gap: var(--space-4);
}

.dashboard-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-4);
  min-width: 0;
}

.dashboard-section-heading h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
}

.dashboard-section-heading a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  background: rgba(255, 240, 232, 0.52);
  color: var(--color-primary-800);
  font-size: var(--text-xs);
  font-weight: 850;
  white-space: nowrap;
}

.dashboard-section-heading a:hover {
  background: rgba(255, 216, 194, 0.42);
  text-decoration: none;
}

.dashboard-view-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.dashboard-view-card,
.dashboard-workbench-card {
  display: grid;
  min-width: 0;
}

.dashboard-view-card {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  min-height: 74px;
  gap: var(--space-3);
  padding: 0 var(--space-5);
}

.dashboard-view-card svg,
.dashboard-workbench-card svg,
.dashboard-record-grid svg {
  width: 21px;
  height: 21px;
  color: var(--color-primary-800);
}

.dashboard-view-card i,
.dashboard-workbench-card i {
  width: 42px;
  height: 42px;
}

.dashboard-view-card span,
.dashboard-workbench-card span {
  overflow: hidden;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-workbench-card span {
  white-space: normal;
}

.dashboard-grid {
  display: grid;
  gap: var(--space-5);
}

.dashboard-alert-grid {
  --dashboard-alert-card-height: auto;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  align-items: start;
}

.dashboard-section-card {
  display: grid;
  min-width: 0;
  padding: clamp(18px, 2vw, 24px);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.86), rgba(255, 250, 244, 0.72)),
    var(--surface);
}

.dashboard-section-card > .dashboard-section {
  gap: var(--space-5);
}

.dashboard-alert-summary-card {
  align-self: start;
}

.dashboard-priority-alerts-card {
  height: var(--dashboard-alert-card-height);
  min-height: 0;
}

.dashboard-priority-alerts {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.dashboard-priority-alerts > .dashboard-section-heading {
  flex: 0 0 auto;
}

.dashboard-operation-stack {
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.dashboard-operation-card {
  display: grid;
  gap: var(--space-5);
  padding: clamp(18px, 2vw, 24px);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.86), rgba(255, 250, 244, 0.72)),
    var(--surface);
}

.dashboard-operation-card .dashboard-section {
  gap: var(--space-5);
}

.dashboard-alert-stack {
  display: grid;
  gap: 10px;
}

.dashboard-alert-pill {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
}

.dashboard-alert-pill span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 850;
}

.dashboard-alert-pill svg {
  width: 18px;
  height: 18px;
}

.dashboard-alert-pill strong {
  display: grid;
  min-width: 38px;
  height: 30px;
  place-items: center;
  border-radius: var(--radius-pill);
  background: rgba(255, 250, 244, 0.82);
  font-size: var(--text-sm);
}

.dashboard-alert-pill.critical {
  border-color: rgba(159, 46, 46, 0.2);
  background: rgba(255, 240, 237, 0.8);
}

.dashboard-alert-pill.warning {
  border-color: rgba(155, 95, 18, 0.18);
  background: rgba(255, 244, 223, 0.82);
}

.dashboard-alert-pill.info {
  border-color: rgba(97, 112, 173, 0.18);
  background: rgba(238, 238, 255, 0.5);
}

.dashboard-alert-pill.approvals {
  border-color: rgba(140, 60, 60, 0.18);
  background: rgba(255, 241, 239, 0.72);
}

.dashboard-category-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-priority-alerts .alert-list {
  align-content: start;
  flex: 1 1 auto;
  gap: 12px;
  grid-auto-rows: max-content;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: auto;
  padding-right: 4px;
  scroll-behavior: smooth;
  scrollbar-color: rgba(194, 101, 42, 0.48) rgba(246, 239, 231, 0.72);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.dashboard-priority-alerts .alert-list::-webkit-scrollbar {
  width: 10px;
}

.dashboard-priority-alerts .alert-list::-webkit-scrollbar-track {
  border-radius: var(--radius-pill);
  background: rgba(246, 239, 231, 0.72);
}

.dashboard-priority-alerts .alert-list::-webkit-scrollbar-thumb {
  border: 2px solid rgba(246, 239, 231, 0.72);
  border-radius: var(--radius-pill);
  background: rgba(194, 101, 42, 0.5);
}

.dashboard-priority-alerts .alert-list::-webkit-scrollbar-thumb:hover {
  background: rgba(194, 101, 42, 0.68);
}

.dashboard-priority-alerts .alert-row {
  align-content: start;
  gap: 8px;
  min-height: 82px;
  border-left-width: 0;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 244, 0.56);
}

.dashboard-priority-alerts .alert-row span:last-child {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.dashboard-priority-alerts .alert-row strong {
  line-height: 1.35;
}

.dashboard-priority-alerts .alert-row small {
  line-height: 1.35;
}

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

.dashboard-count-grid div {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: var(--space-3);
  background: rgba(255, 250, 244, 0.72);
}

.dashboard-count-grid span,
.dashboard-record-grid span,
.dashboard-budget-details dt {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 850;
}

.dashboard-count-grid strong,
.dashboard-record-grid strong,
.dashboard-budget-details dd {
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 28px;
  line-height: 1.05;
}

.dashboard-schedule-panel h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 900;
}

.dashboard-sprint-card {
  display: grid;
  gap: var(--space-3);
}

.dashboard-sprint-list {
  display: grid;
  gap: 10px;
}

.dashboard-sprint-row {
  position: relative;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 10px 12px;
  background: rgba(255, 250, 244, 0.72);
}

.dashboard-sprint-row::before {
  content: "";
  width: 100%;
  height: 10px;
  border-radius: var(--radius-pill);
  background: rgba(43, 126, 190, 0.68);
  grid-column: 2;
  grid-row: 1;
  justify-self: stretch;
  align-self: end;
}

.dashboard-sprint-row.next::before {
  background: rgba(221, 128, 69, 0.72);
}

.dashboard-sprint-row strong {
  grid-row: 1 / span 2;
  color: var(--ink);
  font-weight: 900;
}

.dashboard-sprint-row span {
  grid-column: 2;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 750;
}

.dashboard-budget-visual {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  align-items: stretch;
}

.dashboard-budget-ring-card {
  display: grid;
  min-height: 184px;
  place-items: center;
  padding: var(--space-5);
  background: rgba(255, 250, 244, 0.7);
}

.dashboard-section-heading .dashboard-budget-burn {
  color: var(--color-danger);
  font-weight: 950;
}

.dashboard-budget-ring {
  display: grid;
  width: 148px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--color-surface) 0 42%, transparent 43%),
    conic-gradient(var(--color-primary) 0 var(--burn-percent), rgba(216, 208, 200, 0.72) var(--burn-percent) 100%);
  box-shadow: inset 0 0 0 1px rgba(216, 208, 200, 0.5), var(--shadow-soft);
}

.dashboard-budget-ring span {
  color: var(--color-primary-900);
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.dashboard-budget-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.dashboard-budget-details div {
  display: grid;
  gap: 6px;
  min-height: 86px;
  align-content: center;
  padding: var(--space-4);
  background: rgba(255, 250, 244, 0.72);
}

.dashboard-budget-details dd {
  margin: 0;
}

.dashboard-budget-meter-card {
  padding: var(--space-4);
  background: rgba(255, 250, 244, 0.72);
}

.dashboard-budget-meter {
  margin: 0;
}

.dashboard-workbench-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.dashboard-workbench-card {
  min-height: 132px;
  align-content: start;
  gap: 8px;
  padding: var(--space-5);
}

.dashboard-workbench-card-wide {
  grid-column: span 2;
}

.dashboard-workbench-card small {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 750;
  line-height: 1.35;
}

.dashboard-record-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-4);
}

.project-flow-page {
  display: grid;
  gap: var(--space-6);
}

.project-flow-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: var(--space-5);
  align-items: end;
}

.project-flow-hero h1 {
  max-width: 860px;
  margin: 0;
  font-size: var(--page-heading-size);
  line-height: 1;
}

.project-flow-hero .muted {
  max-width: 780px;
  margin: 8px 0 0;
  font-size: var(--text-base);
}

.project-flow-hero-card {
  display: grid;
  gap: 8px;
  padding: var(--space-5);
  background: linear-gradient(135deg, rgba(255, 240, 232, 0.72), rgba(255, 250, 244, 0.92));
}

.project-flow-hero-card span,
.project-flow-summary-grid .ui-card > span:not(.project-flow-card-icon),
.project-flow-phase-card span {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 850;
  text-transform: uppercase;
}

.project-flow-hero-card strong,
.project-flow-summary-grid strong,
.project-flow-phase-card strong {
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 32px;
  line-height: 1;
}

.project-flow-progress {
  height: 10px;
}

.project-flow-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary-300), var(--color-primary));
}

.project-flow-overview {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.9), rgba(250, 245, 238, 0.74)),
    var(--color-surface);
}

.project-flow-overview-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(216, 208, 200, 0.68);
}

.project-flow-overview-heading h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.project-flow-overview-heading > span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-pill);
  padding: 0 12px;
  background: rgba(255, 240, 232, 0.52);
  color: var(--color-primary-800);
  font-size: var(--text-xs);
  font-weight: 850;
  white-space: nowrap;
}

.project-flow-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
}

.project-flow-project-snapshot {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
}

.project-flow-summary-grid .ui-card,
.project-flow-project-snapshot .ui-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  align-content: start;
  padding: var(--space-4);
  background: rgba(255, 250, 244, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.project-flow-summary-grid .ui-card {
  min-height: 104px;
}

.project-flow-summary-grid .ui-card:nth-child(1),
.project-flow-project-snapshot .ui-card:nth-child(1) {
  background: linear-gradient(135deg, rgba(255, 240, 232, 0.68), rgba(255, 250, 244, 0.86));
}

.project-flow-summary-grid .ui-card:nth-child(2),
.project-flow-project-snapshot .ui-card:nth-child(2) {
  background: linear-gradient(135deg, rgba(255, 244, 223, 0.72), rgba(255, 250, 244, 0.86));
}

.project-flow-summary-grid .ui-card:nth-child(3),
.project-flow-project-snapshot .ui-card:nth-child(3) {
  background: linear-gradient(135deg, rgba(242, 246, 237, 0.72), rgba(255, 250, 244, 0.88));
}

.project-flow-summary-grid .ui-card:nth-child(4),
.project-flow-project-snapshot .ui-card:nth-child(4) {
  background: linear-gradient(135deg, rgba(238, 238, 255, 0.58), rgba(255, 250, 244, 0.88));
}

.project-flow-summary-grid .ui-card:nth-child(5),
.project-flow-project-snapshot .ui-card:nth-child(5) {
  background: linear-gradient(135deg, rgba(246, 239, 231, 0.82), rgba(255, 250, 244, 0.9));
}

.project-flow-card-icon {
  display: inline-grid;
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(194, 101, 42, 0.18);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.72);
  color: var(--color-primary-800);
}

.project-flow-card-icon svg {
  width: 18px;
  height: 18px;
}

.project-flow-summary-grid .ui-card > span:not(.project-flow-card-icon) {
  align-self: end;
  line-height: 1.2;
}

.project-flow-summary-grid strong {
  grid-column: 2;
  font-size: 34px;
}

.project-flow-project-snapshot .ui-card > span:not(.project-flow-card-icon) {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 850;
  text-transform: uppercase;
}

.project-flow-project-snapshot strong {
  grid-column: 2;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.project-flow-project-snapshot small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 750;
  line-height: 1.35;
}

.project-flow-sequence {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(216, 208, 200, 0.7);
  border-radius: var(--radius-md);
  padding: 14px;
  background: rgba(246, 239, 231, 0.52);
}

.project-flow-sequence > div {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(194, 101, 42, 0.2);
  border-radius: var(--radius-pill);
  padding: 0 13px;
  background: rgba(255, 250, 244, 0.84);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(58, 48, 42, 0.04);
}

.project-flow-sequence > div svg {
  width: 16px;
  height: 16px;
}

.project-flow-sequence > svg {
  width: 17px;
  height: 17px;
  color: var(--color-primary);
  flex: 0 0 auto;
}

.project-flow-phase-picker,
.project-flow-detail-stack,
.project-flow-card-stack,
.project-flow-task-list,
.project-flow-column {
  display: grid;
  gap: var(--space-4);
}

.project-flow-phase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.project-flow-phase-card {
  display: grid;
  gap: 8px;
  padding: var(--space-4);
}

.project-flow-phase-card.active {
  border-color: var(--color-primary-border);
  background: linear-gradient(135deg, rgba(255, 240, 232, 0.86), rgba(255, 250, 244, 0.96));
  box-shadow: 0 16px 34px rgba(142, 63, 15, 0.12);
}

.project-flow-phase-card.is-hidden,
.project-flow-phase-detail.is-hidden,
.project-flow-show-all.is-hidden {
  display: none !important;
}

.project-flow-phase-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.project-flow-phase-name {
  color: var(--color-primary-900);
  font-size: var(--text-base);
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-transform: none;
}

.project-flow-phase-card.active .project-flow-phase-name {
  color: var(--color-primary-950);
}

.project-flow-phase-card small {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 750;
  line-height: 1.4;
}

.project-flow-phase-detail {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5);
  background: rgba(255, 250, 244, 0.8);
}

.project-flow-phase-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-4);
}

.project-flow-phase-header h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
}

.project-flow-phase-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
}

.project-flow-phase-actions a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-md);
  padding: 0 10px;
  background: rgba(255, 240, 232, 0.52);
  color: var(--color-primary-800);
  font-size: var(--text-xs);
  font-weight: 850;
  text-decoration: none;
}

.project-flow-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--space-4);
  align-items: start;
}

.project-flow-column-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.project-flow-column-heading h3 {
  margin: 0;
  font-size: var(--text-lg);
}

.project-flow-column-heading span {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 850;
  text-transform: uppercase;
}

.project-flow-node {
  display: grid;
  gap: var(--space-3);
  border: 1px solid rgba(216, 208, 200, 0.72);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: rgba(255, 250, 244, 0.72);
  box-shadow: var(--shadow-soft);
}

.project-flow-milestone-node {
  background: linear-gradient(135deg, rgba(255, 244, 223, 0.46), rgba(255, 250, 244, 0.88));
}

.project-flow-node header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-3);
}

.project-flow-node header a,
.project-flow-node header strong {
  color: var(--ink);
  font-size: var(--text-base);
  font-weight: 900;
  line-height: 1.3;
  text-decoration: none;
}

.project-flow-node header > span {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 850;
  white-space: nowrap;
}

.project-flow-node-meta,
.project-flow-sprint-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.project-flow-node-meta small,
.project-flow-sprint-strip small {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 750;
}

.project-flow-sprint-strip {
  border: 1px solid rgba(194, 101, 42, 0.2);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: rgba(255, 240, 232, 0.42);
}

.project-flow-sprint-strip > span {
  color: var(--color-primary-800);
  font-size: var(--text-xs);
  font-weight: 900;
  text-transform: uppercase;
}

.project-flow-sprint-strip a {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 900;
  text-decoration: none;
}

.project-flow-task-list {
  gap: var(--space-2);
}

.project-flow-task-list a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  border: 1px solid rgba(216, 208, 200, 0.66);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: rgba(255, 250, 244, 0.74);
  color: var(--ink);
  text-decoration: none;
}

.project-flow-task-list a:hover,
.project-flow-task-list a:focus-visible {
  border-color: var(--color-primary-border);
  background: var(--color-primary-50);
}

.project-flow-task-list strong {
  color: var(--color-primary-800);
  font-size: var(--text-xs);
  font-weight: 900;
}

.project-flow-task-list span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: var(--text-sm);
  font-weight: 800;
}

.project-flow-task-list small {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 750;
  white-space: nowrap;
}

.project-flow-empty {
  display: grid;
  gap: 4px;
  border: 1px dashed rgba(216, 208, 200, 0.82);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: rgba(255, 250, 244, 0.62);
  color: var(--muted);
}

.project-flow-empty strong {
  color: var(--ink);
}

.dashboard-record-grid div {
  display: grid;
  min-height: 94px;
  align-content: center;
  gap: 6px;
  padding: var(--space-4);
  background: rgba(255, 250, 244, 0.78);
}

.rag-badge {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: rgba(246, 239, 231, 0.72);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
}

.rag-badge-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(216, 208, 200, 0.34);
}

.rag-badge-red {
  border-color: var(--color-danger-border);
  background: var(--color-danger-surface);
  color: var(--color-danger);
}

.rag-badge-amber {
  border-color: var(--color-warning-border);
  background: var(--color-warning-surface);
  color: var(--color-warning);
}

.rag-badge-green {
  border-color: var(--color-success-border);
  background: var(--color-success-surface);
  color: var(--color-success);
}

.rag-badge-blue {
  border-color: var(--color-info-border);
  background: var(--color-info-surface);
  color: var(--color-info);
}

.rag-badge-compact {
  min-height: 24px;
  padding: 0 8px;
  gap: 6px;
  font-size: 11px;
}

.rag-badge-compact .rag-badge-dot {
  width: 7px;
  height: 7px;
}

.rag-meta-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  line-height: 1.45;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-md);
}

.table-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid rgba(216, 208, 200, 0.72);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.table-wrap table {
  min-width: 720px;
}

.action-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.header-actions,
.form-actions,
.inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.compact-panel {
  padding: var(--space-4);
  gap: var(--space-3);
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: var(--space-3);
  align-items: end;
}

.filter-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.record-controls-shell {
  padding: clamp(12px, 1.35vw, 16px);
}

.record-controls-parent {
  display: grid;
  gap: 8px;
}

.record-controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(216, 208, 200, 0.72);
}

.record-controls-header h2 {
  margin: 2px 0 0;
  font-size: clamp(16px, 1.45vw, 18px);
  line-height: var(--leading-heading);
}

.record-controls-header .muted {
  margin-top: 2px;
  font-size: var(--text-xs);
}

.record-filter-form {
  display: grid;
  gap: 8px;
  position: relative;
  padding-bottom: 13px;
}

.record-search-row {
  display: contents;
}

.record-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  align-items: end;
}

.record-search-control,
.record-filter-grid label {
  min-width: 0;
}

.record-search-control {
  display: grid;
  grid-column: span 3;
  gap: 5px;
  position: relative;
  z-index: 8;
}

.record-search-dialog {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  width: min(680px, 100%);
  max-height: min(360px, 58vh);
  overflow-y: auto;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(194, 101, 42, 0.22);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(255, 250, 244, 0.94)),
    var(--surface);
  box-shadow: 0 18px 44px rgba(58, 48, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.record-search-dialog[hidden] {
  display: none;
}

.record-search-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(216, 208, 200, 0.72);
}

.record-search-dialog-header strong {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 900;
}

.record-search-dialog-header small,
.record-search-empty {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 750;
}

.record-search-suggestion-list {
  display: grid;
  gap: 6px;
}

.record-search-suggestion,
.record-search-empty {
  display: grid;
  gap: 4px;
  min-height: 48px;
  align-content: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.72);
}

.record-search-suggestion {
  color: var(--ink);
}

.record-search-suggestion:hover,
.record-search-suggestion:focus-visible,
.record-search-suggestion.active,
.record-search-suggestion[aria-selected="true"] {
  border-color: var(--color-primary-border);
  background: var(--color-primary-50);
  color: var(--color-primary-900);
  text-decoration: none;
}

.record-search-suggestion strong {
  color: currentColor;
  font-size: var(--text-sm);
  font-weight: 900;
  line-height: 1.3;
}

.record-search-suggestion small {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 750;
  line-height: 1.35;
}

.record-filter-actions {
  display: flex;
  align-self: end;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  min-width: 74px;
  padding-top: 0;
}

.record-filter-actions .secondary-link {
  min-height: 40px;
  white-space: nowrap;
}

.record-filter-status {
  position: absolute;
  left: 0;
  bottom: -2px;
  min-height: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 800;
}

.record-filter-status[data-state="loading"] {
  color: var(--color-primary-800);
}

.record-filter-status[data-state="success"] {
  color: var(--color-success);
}

.record-filter-status[data-state="error"] {
  color: var(--color-danger);
}

.evidence-filter-form {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-bottom: 0;
}

.evidence-filter-form .record-filter-grid {
  order: 1;
}

.evidence-filter-form .record-filter-actions {
  order: 2;
}

.record-saved-region {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 8px;
  align-items: center;
}

.record-saved-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(216, 208, 200, 0.72);
  border-radius: var(--radius-md);
  min-height: 50px;
  padding: 8px 10px;
  background: rgba(255, 250, 244, 0.58);
}

.record-saved-heading,
.record-saved-heading > div,
.record-save-card > div {
  min-width: 0;
}

.record-saved-heading > div,
.record-save-card > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.record-saved-card h3 {
  margin: 0;
  font-size: var(--text-xs);
  line-height: var(--leading-heading);
}

.record-saved-card .muted {
  margin: 0;
  font-size: var(--text-xs);
}

.record-saved-list {
  justify-content: flex-start;
  flex: 1 1 auto;
  min-width: 0;
}

.record-saved-list a {
  justify-content: flex-start;
  min-height: 30px;
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.76);
}

.record-save-card {
  align-items: center;
}

.record-save-form {
  align-items: end;
  flex-wrap: nowrap;
  gap: 8px;
  margin-left: auto;
}

.record-save-form .text-input,
.record-save-form input[type="text"] {
  flex: 1 1 180px;
  min-width: 0;
}

.split-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: var(--space-5);
  margin: 0;
}

.saved-view-panel h2 {
  margin-bottom: 10px;
}

.saved-view-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.saved-view-list a {
  min-height: 36px;
  padding: 0 12px;
}

.record-results-panel {
  gap: var(--space-4);
  transition: opacity 160ms ease, transform 160ms ease;
}

.record-results-panel.is-updating {
  opacity: 0.74;
  transform: translateY(1px);
}

.resource-listing-stack {
  display: grid;
  gap: 12px;
}

.resource-group-card {
  overflow: hidden;
  border: 1px solid rgba(216, 208, 200, 0.78);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.86), rgba(252, 246, 239, 0.76)),
    var(--surface);
  box-shadow: 0 12px 30px rgba(58, 48, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.resource-group-header {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(194, 101, 42, 0.08), rgba(255, 250, 244, 0.2)),
    transparent;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.resource-group-header:hover,
.resource-group-header:focus-visible {
  background:
    linear-gradient(90deg, rgba(194, 101, 42, 0.12), rgba(255, 250, 244, 0.28)),
    transparent;
  color: var(--ink);
  transform: none;
}

.resource-group-header:focus-visible {
  outline: 2px solid rgba(194, 101, 42, 0.42);
  outline-offset: -4px;
}

.resource-group-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.resource-group-heading > span:last-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.resource-group-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(194, 101, 42, 0.22);
  border-radius: var(--radius-md);
  background: rgba(255, 239, 226, 0.8);
  color: var(--color-primary-800);
}

.resource-group-icon svg {
  width: 18px;
  height: 18px;
}

.resource-group-heading strong {
  color: var(--ink);
  font-size: clamp(16px, 1.5vw, 20px);
  font-weight: 900;
  line-height: var(--leading-heading);
}

.resource-group-heading small {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 750;
  line-height: 1.35;
}

.resource-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(216, 208, 200, 0.82);
  border-radius: var(--radius-pill);
  background: rgba(255, 250, 244, 0.84);
  color: var(--color-primary-900);
  font-size: var(--text-xs);
  font-weight: 900;
  white-space: nowrap;
}

.resource-group-chevron {
  width: 18px;
  height: 18px;
  color: var(--color-primary-800);
  transition: transform 180ms ease;
}

.resource-group-card[data-collapsed="true"] .resource-group-chevron {
  transform: rotate(-90deg);
}

.resource-group-body {
  display: grid;
  gap: 0;
  padding: 0 12px 12px;
  animation: resourceGroupIn 180ms ease both;
}

.resource-group-body[hidden] {
  display: none;
}

.resource-table-wrap {
  background: rgba(255, 250, 244, 0.66);
}

.resource-empty-row td {
  color: var(--muted);
  font-weight: 800;
}

@keyframes resourceGroupIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.progress-cell {
  display: grid;
  min-width: 132px;
  gap: 6px;
}

.progress-cell > span:first-child {
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: 900;
}

.progress-track {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(216, 208, 200, 0.72);
  border-radius: var(--radius-pill);
  background: rgba(246, 239, 231, 0.88);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary-400), var(--color-success));
}

.detail-progress-cell {
  width: min(100%, 260px);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
  margin: 0;
}

.stacked-panels {
  display: grid;
  gap: var(--space-5);
}

.detail-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.detail-panel-heading h2 {
  margin: 0;
}

.detail-panel-heading span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: rgba(246, 239, 231, 0.62);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 800;
}

.detail-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(216, 208, 200, 0.68);
  border-radius: var(--radius-md);
  margin: 0;
  background: rgba(255, 250, 244, 0.56);
}

.detail-grid dt {
  min-width: 0;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(216, 208, 200, 0.62);
  background: rgba(246, 239, 231, 0.48);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.detail-grid dd {
  margin: 0;
  min-width: 0;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(216, 208, 200, 0.62);
  overflow-wrap: anywhere;
}

.detail-grid dt:nth-last-child(2),
.detail-grid dd:last-child {
  border-bottom: 0;
}

.detail-record-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 10px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.detail-record-row {
  display: grid;
  grid-template-columns: minmax(128px, 0.36fr) minmax(0, 1fr);
  min-width: 0;
  min-height: 58px;
  overflow: hidden;
  border: 1px solid rgba(216, 208, 200, 0.68);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.detail-record-grid .detail-record-row dt,
.detail-record-grid .detail-record-row dd {
  display: flex;
  min-width: 0;
  align-items: center;
  border-bottom: 0;
}

.detail-record-grid .detail-record-row dt {
  border-right: 1px solid rgba(216, 208, 200, 0.62);
}

.detail-record-grid .detail-record-row dd {
  color: var(--color-ink);
  line-height: 1.45;
}

.form-panel {
  width: min(100%, 900px);
  max-width: 900px;
}

.operating-form-panel {
  justify-self: center;
  width: min(100%, 920px);
}

.operating-form p {
  display: grid;
  gap: 6px;
  margin: 0;
}

.operating-form label {
  display: block;
}

.owner-multiselect-control {
  position: relative;
  width: 100%;
}

.owner-multiselect-toggle {
  display: flex;
  width: 100%;
  min-height: var(--control-height);
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0 12px;
  background: rgba(255, 250, 244, 0.78);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 800;
  line-height: 1.2;
  box-shadow: inset 0 1px 2px rgba(58, 48, 42, 0.03);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.owner-multiselect-toggle:hover,
.owner-multiselect-control.open .owner-multiselect-toggle {
  border-color: rgba(194, 101, 42, 0.32);
  background: var(--color-surface);
}

.owner-multiselect-toggle:focus-visible {
  border-color: var(--color-primary);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px var(--color-focus);
  outline: none;
}

.owner-multiselect-toggle[data-state="empty"] .owner-multiselect-summary {
  color: var(--color-secondary-500);
}

.owner-multiselect-summary {
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-multiselect-toggle svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--accent-strong);
  transition: transform 160ms ease;
}

.owner-multiselect-control.open .owner-multiselect-toggle svg {
  transform: rotate(180deg);
}

.owner-multiselect-panel {
  position: absolute;
  z-index: 42;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  display: grid;
  gap: var(--space-2);
  inline-size: max(100%, min(24rem, calc(100vw - 32px)));
  max-inline-size: calc(100vw - 32px);
  padding: var(--space-2);
  border: 1px solid rgba(216, 208, 200, 0.92);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(250, 245, 238, 0.98)),
    var(--surface);
  box-shadow: 0 18px 42px rgba(58, 48, 42, 0.12);
}

.owner-multiselect-control[data-align="end"] .owner-multiselect-panel {
  right: 0;
  left: auto;
}

.owner-multiselect-search {
  width: 100%;
  min-height: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0 10px;
  background: var(--color-surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
}

.owner-multiselect-options {
  display: grid;
  max-height: min(320px, 46vh);
  gap: 7px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 3px 2px 2px;
  overscroll-behavior: auto;
  scroll-behavior: smooth;
}

.owner-multiselect-widget {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.owner-multiselect-widget > div {
  margin: 0;
}

.owner-multiselect-widget label {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  min-height: 40px;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(216, 208, 200, 0.66);
  border-radius: var(--radius-sm);
  background: rgba(255, 250, 244, 0.72);
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: 800;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.owner-multiselect-widget label:hover {
  border-color: rgba(194, 101, 42, 0.34);
  background: var(--color-primary-50);
  box-shadow: inset 3px 0 0 rgba(194, 101, 42, 0.28);
}

.owner-multiselect-widget label:has(input:focus-visible) {
  border-color: var(--color-primary);
  background: var(--color-primary-50);
  box-shadow: 0 0 0 3px var(--color-focus), inset 3px 0 0 rgba(194, 101, 42, 0.36);
}

.owner-multiselect-widget label:has(input:checked) {
  border-color: var(--color-primary-border);
  background: var(--color-primary-50);
  color: var(--color-primary-800);
  font-weight: 900;
  box-shadow: inset 3px 0 0 var(--color-primary-600);
}

.owner-multiselect-widget input[type="checkbox"] {
  flex: 0 0 auto;
  inline-size: 16px;
  block-size: 16px;
  margin-top: 1px;
  accent-color: var(--color-primary-600);
}

.owner-multiselect-empty {
  margin: 0;
  padding: 10px;
  border: 1px dashed rgba(216, 208, 200, 0.82);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}

.auto-generated-id-input[readonly],
.auto-managed-date-input[readonly],
.auto-calculated-input[readonly],
.auto-calculated-input:disabled {
  border-style: dashed;
  background: rgba(246, 239, 231, 0.76);
  color: var(--muted);
  cursor: not-allowed;
}

.operating-form-actions {
  justify-content: flex-end;
  padding-top: var(--space-2);
  border-top: 1px solid rgba(216, 208, 200, 0.62);
}

.subtask-formset,
.document-link-form {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid rgba(216, 208, 200, 0.62);
}

.subtask-formset-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.subtask-formset-heading h2 {
  margin: 2px 0 0;
  font-size: var(--text-lg);
}

.subtask-formset-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 800;
  line-height: 1.5;
}

.subtask-formset-list {
  display: grid;
  gap: var(--space-3);
}

.subtask-form-row {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid rgba(216, 208, 200, 0.72);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.68);
}

.subtask-id-title-fields {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(220px, 1.3fr);
  gap: var(--space-3);
  align-items: end;
}

.subtask-owner-field {
  margin: 0;
}

.subtask-main-fields,
.subtask-state-fields,
.compact-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
  align-items: end;
}

.subtask-notes-field {
  margin: 0;
}

.subtask-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.checkbox-field {
  display: inline-flex;
  min-height: var(--control-height);
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 800;
}

.checkbox-field input {
  inline-size: 18px;
  block-size: 18px;
  accent-color: var(--color-primary-600);
}

.delete-field {
  color: var(--color-danger);
}

.status-value-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(216, 208, 200, 0.72);
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.78);
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.status-value-badge.compact {
  min-height: 28px;
  padding-inline: 9px;
}

.status-value-badge-empty {
  color: var(--muted);
}

.status-value-badge-open {
  border-color: rgba(103, 122, 139, 0.28);
  background: rgba(239, 244, 248, 0.86);
  color: #435364;
}

.status-value-badge-not-started {
  border-color: rgba(133, 121, 110, 0.26);
  background: rgba(246, 239, 231, 0.88);
  color: #6f5f52;
}

.status-value-badge-in-progress {
  border-color: rgba(73, 137, 178, 0.3);
  background: rgba(230, 244, 252, 0.9);
  color: #22658f;
}

.status-value-badge-ready-review {
  border-color: rgba(111, 119, 194, 0.3);
  background: rgba(238, 240, 255, 0.9);
  color: #4e5798;
}

.status-value-badge-pending {
  border-color: rgba(184, 130, 44, 0.32);
  background: rgba(255, 246, 222, 0.92);
  color: #8a5c12;
}

.status-value-badge-pending-approval {
  border-color: rgba(194, 101, 42, 0.3);
  background: rgba(255, 239, 224, 0.92);
  color: var(--color-primary-800);
}

.status-value-badge-submitted {
  border-color: rgba(83, 137, 146, 0.3);
  background: rgba(230, 247, 247, 0.9);
  color: #2f6970;
}

.status-value-badge-approved {
  border-color: rgba(75, 139, 92, 0.32);
  background: rgba(233, 247, 236, 0.92);
  color: #2f6f43;
}

.status-value-badge-active {
  border-color: rgba(51, 148, 136, 0.3);
  background: rgba(228, 249, 246, 0.92);
  color: #20786f;
}

.status-value-badge-complete {
  border-color: rgba(88, 150, 79, 0.34);
  background: rgba(236, 248, 228, 0.94);
  color: #3e7a32;
}

.status-value-badge-closed {
  border-color: rgba(95, 107, 116, 0.3);
  background: rgba(235, 238, 240, 0.92);
  color: #4d5961;
}

.status-value-badge-blocked {
  border-color: rgba(145, 52, 52, 0.34);
  background: rgba(252, 231, 231, 0.94);
  color: #8f2d2d;
}

.status-value-badge-rejected {
  border-color: rgba(159, 46, 46, 0.34);
  background: rgba(255, 226, 226, 0.94);
  color: #9a2f2f;
}

.status-value-badge-rule {
  border-color: rgba(127, 92, 166, 0.32);
  background: rgba(245, 237, 252, 0.92);
  color: #68458d;
}

.status-value-badge-budgeted {
  border-color: rgba(67, 138, 113, 0.3);
  background: rgba(231, 247, 240, 0.92);
  color: #2d745b;
}

.status-value-badge-unbudgeted {
  border-color: rgba(156, 105, 55, 0.3);
  background: rgba(250, 239, 226, 0.92);
  color: #8a5a2c;
}

.status-value-badge-on-track {
  border-color: rgba(72, 146, 75, 0.32);
  background: rgba(234, 248, 232, 0.92);
  color: #3a7d38;
}

.status-value-badge-at-risk {
  border-color: rgba(198, 151, 38, 0.34);
  background: rgba(255, 248, 219, 0.94);
  color: #8a6713;
}

.status-value-badge-overdue {
  border-color: rgba(178, 64, 52, 0.34);
  background: rgba(255, 232, 228, 0.94);
  color: #9e3c32;
}

.status-value-badge-delayed {
  border-color: rgba(180, 95, 52, 0.34);
  background: rgba(255, 239, 226, 0.94);
  color: #9a4f2c;
}

.status-value-badge-on-budget {
  border-color: rgba(61, 139, 101, 0.32);
  background: rgba(229, 248, 238, 0.92);
  color: #2e7653;
}

.status-value-badge-under-budget {
  border-color: rgba(55, 133, 159, 0.32);
  background: rgba(226, 246, 252, 0.92);
  color: #28708a;
}

.status-value-badge-over-budget {
  border-color: rgba(177, 78, 58, 0.34);
  background: rgba(255, 235, 230, 0.94);
  color: #9b4534;
}

.status-value-badge-unallocated {
  border-color: rgba(124, 119, 132, 0.28);
  background: rgba(241, 239, 244, 0.9);
  color: #635d6b;
}

.status-value-badge-partially-allocated {
  border-color: rgba(71, 127, 174, 0.3);
  background: rgba(229, 242, 252, 0.9);
  color: #336e9b;
}

.status-value-badge-allocated {
  border-color: rgba(64, 139, 118, 0.32);
  background: rgba(229, 248, 242, 0.92);
  color: #2b745f;
}

.status-value-badge-overallocated {
  border-color: rgba(161, 72, 94, 0.34);
  background: rgba(253, 231, 237, 0.94);
  color: #914057;
}

.task-subtasks-panel {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.task-subtasks-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.task-subtasks-heading h2 {
  margin: 2px 0 0;
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  line-height: var(--leading-heading);
}

.task-subtasks-heading span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(216, 208, 200, 0.7);
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.72);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 900;
}

.task-subtasks-list {
  display: grid;
  gap: var(--space-3);
}

.task-subtask-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid rgba(216, 208, 200, 0.76);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.9), rgba(250, 245, 238, 0.74)),
    var(--surface);
  box-shadow: 0 12px 28px rgba(58, 48, 42, 0.06);
  transition: opacity 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.task-subtask-card.is-complete {
  border-color: rgba(132, 151, 107, 0.38);
  background: rgba(244, 247, 239, 0.72);
  opacity: 0.68;
}

.task-subtask-card.is-updating {
  cursor: progress;
}

.task-subtask-card.is-updating .subtask-complete-toggle {
  opacity: 0.72;
  pointer-events: none;
}

.task-subtask-card-header,
.task-subtask-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.task-subtask-complete-form {
  margin: 0;
}

.subtask-complete-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 900;
  cursor: pointer;
}

.subtask-complete-toggle input {
  inline-size: 18px;
  block-size: 18px;
  accent-color: var(--color-primary-600);
}

.subtask-complete-toggle.read-only {
  cursor: default;
}

.task-subtask-card.is-complete .task-subtask-card-body h3 {
  color: var(--muted);
  text-decoration: line-through;
}

.subtask-status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(216, 208, 200, 0.72);
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.74);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 900;
}

.subtask-status-pill.complete {
  border-color: rgba(132, 151, 107, 0.4);
  background: rgba(237, 246, 227, 0.86);
  color: #4d6b38;
}

.task-subtask-card-body {
  display: grid;
  gap: var(--space-2);
}

.task-subtask-card-body h3 {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-lg);
  line-height: 1.35;
}

.task-subtask-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.55;
}

.task-subtask-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin: 0;
}

.task-subtask-meta div {
  display: grid;
  gap: 4px;
}

.task-subtask-meta dt {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 900;
  text-transform: uppercase;
}

.task-subtask-meta dd {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 850;
}

.task-subtask-meta del {
  color: var(--muted);
}

.task-subtask-meta strong {
  color: var(--color-primary-800);
}

.task-subtask-date-form {
  display: flex;
  align-items: end;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin: 0;
}

.task-subtask-date-form label {
  display: grid;
  gap: 6px;
  min-width: min(220px, 100%);
  margin: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 900;
}

.task-subtask-delete-form {
  margin: 0;
}

.task-subtask-pagination {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.task-subtask-pagination a {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(194, 101, 42, 0.24);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.82);
  color: var(--color-primary-800);
  font-size: var(--text-lg);
  font-weight: 900;
  text-decoration: none;
}

.task-subtask-pagination a:hover,
.task-subtask-pagination a:focus-visible {
  border-color: rgba(194, 101, 42, 0.42);
  background: var(--color-primary-50);
}

.task-subtasks-empty {
  display: grid;
  gap: 4px;
  padding: var(--space-4);
  border: 1px dashed rgba(216, 208, 200, 0.82);
  border-radius: var(--radius-md);
  color: var(--muted);
}

.task-subtasks-empty strong {
  color: var(--ink);
}

.hierarchy-panel,
.document-link-panel {
  gap: var(--space-4);
}

.hierarchy-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}

.hierarchy-link-card,
.hierarchy-mini-list a,
.document-link-list a {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(216, 208, 200, 0.72);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.68);
  color: var(--ink);
  text-decoration: none;
}

.hierarchy-link-card:hover,
.hierarchy-link-card:focus-visible,
.hierarchy-mini-list a:hover,
.hierarchy-mini-list a:focus-visible,
.document-link-list a:hover,
.document-link-list a:focus-visible {
  border-color: var(--color-primary-border);
  background: var(--color-primary-50);
  color: var(--color-primary-900);
}

.hierarchy-link-card small,
.hierarchy-mini-list span,
.document-link-list span {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 750;
}

.hierarchy-link-card strong,
.hierarchy-mini-list strong,
.document-link-list strong {
  color: currentColor;
  font-size: var(--text-sm);
  font-weight: 900;
}

.hierarchy-child-group {
  display: grid;
  gap: var(--space-2);
}

.hierarchy-child-group h3 {
  margin: 0;
  font-size: var(--text-sm);
}

.primary-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-height);
  padding: 0 18px;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-md);
  background: var(--color-primary-600);
  color: #fffaf4;
  font-weight: 850;
  box-shadow: var(--shadow-soft);
}

.primary-action-button:hover,
.primary-action-button:focus-visible {
  background: var(--color-primary-700);
  color: #fffaf4;
  transform: translateY(-1px);
}

.primary-action-button svg {
  width: 17px;
  height: 17px;
}

.secondary-action-button,
.danger-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 850;
  box-shadow: none;
}

.secondary-action-button {
  border: 1px solid rgba(194, 101, 42, 0.28);
  background: rgba(255, 250, 244, 0.82);
  color: var(--color-primary-800);
}

.secondary-action-button:hover,
.secondary-action-button:focus-visible {
  border-color: rgba(194, 101, 42, 0.42);
  background: var(--color-primary-50);
  color: var(--color-primary-800);
}

.add-subtask-button {
  border-color: rgba(194, 101, 42, 0.44);
  background: linear-gradient(180deg, var(--color-primary-100), var(--color-primary-50));
  color: var(--color-primary-900);
  box-shadow: 0 10px 22px rgba(142, 63, 15, 0.1);
}

.add-subtask-button:hover,
.add-subtask-button:focus-visible {
  border-color: rgba(194, 101, 42, 0.58);
  background: linear-gradient(180deg, var(--color-primary-200), var(--color-primary-100));
  color: var(--color-primary-950);
  transform: translateY(-1px);
}

.danger-action-button {
  border: 1px solid var(--color-danger-border);
  background: var(--color-tertiary-50);
  color: var(--color-tertiary-800);
}

.danger-action-button:hover,
.danger-action-button:focus-visible {
  border-color: rgba(159, 46, 46, 0.36);
  background: rgba(253, 230, 230, 0.92);
  color: var(--color-tertiary-800);
}

.secondary-action-button svg,
.danger-action-button svg {
  width: 16px;
  height: 16px;
}

.form-draft-status {
  min-height: 18px;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 700;
}

.spaced-form {
  margin-top: 12px;
}

.mini-list {
  display: grid;
  gap: 12px;
}

.mini-list > div {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: rgba(255, 250, 244, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.mini-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.45;
}

.audit-panel {
  gap: var(--space-4);
}

.audit-heading,
.audit-entry-topline,
.audit-entry-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.audit-heading h2 {
  margin: 0;
}

.audit-count,
.audit-action-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 750;
}

.audit-count {
  padding: 0 12px;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  background: rgba(246, 239, 231, 0.62);
}

.audit-timeline {
  position: relative;
  display: grid;
  gap: var(--space-4);
}

.audit-timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 10px;
  width: 1px;
  background: linear-gradient(var(--color-primary-200), var(--color-secondary-200));
}

.audit-entry {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: var(--space-3);
}

.audit-entry-marker {
  position: relative;
  z-index: 1;
  width: 21px;
  height: 21px;
  margin-top: 15px;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  box-shadow: 0 0 0 4px rgba(255, 250, 244, 0.92);
}

.audit-entry-body {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(216, 208, 200, 0.7);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.68);
}

.audit-entry-topline time,
.audit-entry-title-row span {
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.4;
}

.audit-action-pill {
  padding: 0 10px;
  color: var(--color-primary-700);
  border: 1px solid var(--color-primary-border);
  background: var(--color-primary-50);
}

.audit-entry-created .audit-action-pill,
.audit-entry-approved .audit-action-pill,
.audit-entry-submitted .audit-action-pill {
  color: var(--color-success);
  border-color: var(--color-success-border);
  background: var(--color-success-surface);
}

.audit-entry-deleted .audit-action-pill,
.audit-entry-rejected .audit-action-pill {
  color: var(--color-danger);
  border-color: var(--color-danger-border);
  background: var(--color-danger-surface);
}

.audit-entry-title-row h3 {
  margin: 0;
  min-width: 0;
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.audit-meta-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0;
  color: var(--color-muted);
  font-size: 12px;
}

.audit-meta-grid dt {
  font-weight: 750;
  text-transform: uppercase;
}

.audit-meta-grid dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.audit-change-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: var(--space-3);
}

.audit-change-arrow {
  align-self: center;
  color: var(--color-primary-700);
  font-size: 12px;
  font-weight: 850;
}

.audit-value-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(216, 208, 200, 0.64);
  border-radius: var(--radius-sm);
  background: rgba(246, 239, 231, 0.46);
}

.audit-value-card > span {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.audit-value-card strong,
.audit-value-card summary,
.audit-value-card dd {
  color: var(--color-ink);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.audit-value-card details {
  min-width: 0;
}

.audit-value-card summary {
  cursor: pointer;
  font-weight: 750;
}

.audit-value-card dl {
  display: grid;
  grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
  gap: 7px 10px;
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(216, 208, 200, 0.68);
}

.audit-value-card dt {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.audit-value-card dd {
  margin: 0;
}

.audit-empty {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.68);
}

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

.review-form {
  min-width: 220px;
  margin-bottom: 10px;
}

.dashboard-columns {
  margin-bottom: 20px;
}

.weekly-report-summary-row {
  --weekly-report-summary-height: auto;
  align-items: start;
}

.weekly-report-page {
  display: grid;
  gap: var(--space-5);
}

.weekly-report-hero {
  align-items: stretch;
  padding: clamp(18px, 2vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 250, 244, 0.94), rgba(246, 239, 231, 0.76)),
    var(--surface);
  box-shadow: 0 12px 32px rgba(58, 48, 42, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.weekly-report-mode-card {
  display: grid;
  min-width: min(100%, 230px);
  align-content: center;
  justify-items: end;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.72);
}

.weekly-report-mode-card > span {
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 850;
  text-transform: uppercase;
}

.weekly-report-metrics {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.weekly-report-summary-panel {
  align-self: start;
}

.weekly-report-detail-grid {
  grid-template-columns: minmax(150px, 0.9fr) minmax(0, 1.1fr);
}

.weekly-report-progress-stack {
  display: grid;
  gap: 10px;
}

.weekly-report-progress-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(216, 208, 200, 0.72);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.62);
}

.weekly-report-progress-card > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.weekly-report-progress-card span {
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 850;
  text-transform: uppercase;
}

.weekly-report-progress-card strong {
  color: var(--ink);
  font-size: var(--text-lg);
  line-height: 1;
}

.weekly-report-progress-card .muted {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 750;
}

.weekly-report-progress-meter {
  height: 12px;
  margin: 0;
}

.weekly-report-progress-meter span {
  max-width: 100%;
  background: linear-gradient(90deg, var(--color-primary-600), var(--color-primary-300));
}

.weekly-report-progress-meter.budget span {
  background: linear-gradient(90deg, var(--color-warning), var(--color-primary-300));
}

.weekly-report-alerts-panel {
  grid-template-rows: auto minmax(0, 1fr);
  height: var(--weekly-report-summary-height);
  min-height: 0;
}

.weekly-report-alerts-panel .alert-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: auto;
  padding-right: 4px;
  scroll-behavior: smooth;
  scrollbar-color: rgba(194, 101, 42, 0.48) rgba(246, 239, 231, 0.72);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.weekly-report-alerts-panel .alert-list::-webkit-scrollbar {
  width: 10px;
}

.weekly-report-alerts-panel .alert-list::-webkit-scrollbar-track {
  border-radius: var(--radius-pill);
  background: rgba(246, 239, 231, 0.72);
}

.weekly-report-alerts-panel .alert-list::-webkit-scrollbar-thumb {
  border: 2px solid rgba(246, 239, 231, 0.72);
  border-radius: var(--radius-pill);
  background: rgba(194, 101, 42, 0.5);
}

.weekly-report-alerts-panel .alert-list::-webkit-scrollbar-thumb:hover {
  background: rgba(194, 101, 42, 0.68);
}

.weekly-report-table-section {
  gap: var(--space-4);
}

.weekly-report-table-section .dashboard-section-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(216, 208, 200, 0.68);
}

.weekly-report-table-wrap table {
  min-width: 780px;
}

.weekly-report-table-wrap td,
.weekly-report-table-wrap th {
  vertical-align: top;
}

.compact-record-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.category-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-strip span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.72);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.alert-list {
  display: grid;
  gap: 12px;
}

.alert-row {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.7);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.alert-row:hover,
.roadmap-item:hover {
  box-shadow: var(--shadow-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

.alert-row small,
.roadmap-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.4;
}

.alert-row span:last-child {
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.alert-critical {
  border-left-color: var(--danger);
  background: rgba(255, 240, 237, 0.78);
}

.alert-warning {
  border-left-color: var(--warning);
  background: rgba(255, 244, 223, 0.8);
}

.alert-info {
  border-left-color: var(--accent);
  background: rgba(246, 239, 231, 0.7);
}

.alert-group + .alert-group {
  margin-top: 20px;
}

.progress-meter {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-surface-container);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}

.progress-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.compact-meter {
  min-width: 120px;
  max-width: 180px;
  height: 10px;
  margin-bottom: 4px;
}

.roadmap {
  display: grid;
  gap: 12px;
}

.roadmap-item {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 130px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.7);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.roadmap-item.overdue {
  border-left-color: var(--danger);
  background: rgba(255, 240, 237, 0.78);
}

.roadmap-item.due-soon {
  border-left-color: var(--warning);
  background: rgba(255, 244, 223, 0.8);
}

.roadmap-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  background: rgba(246, 239, 231, 0.82);
}

tbody tr {
  background: rgba(255, 250, 244, 0.42);
}

tbody tr:nth-child(even) {
  background: rgba(246, 239, 231, 0.32);
}

tbody tr:hover {
  background: rgba(255, 240, 232, 0.48);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td form {
  margin: 0;
}

td .secondary,
td button,
td .secondary-link,
td a {
  white-space: nowrap;
}

td[colspan] {
  color: var(--muted);
  font-weight: 750;
  text-align: center;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

@media (max-width: 820px) {
  :root {
    --page-heading-size: 22px;
  }

  .with-sidebar {
    --sidebar-width: 244px;
  }

  .top-navigation {
    margin-left: 0;
  }

  .nav-collapsed .top-navigation {
    margin-left: 0;
  }

  .top-nav-inner {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas:
      "menu brand profile"
      "actions actions actions";
    gap: 8px 10px;
    min-height: 68px;
    padding: 10px 14px;
  }

  .role-select-shell .top-nav-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand profile"
      "actions actions";
  }

  .top-nav-mobile-brand {
    grid-area: brand;
    display: inline-flex;
    min-width: 0;
    align-items: baseline;
    color: var(--ink);
    font-size: var(--text-lg);
    font-weight: 850;
    white-space: nowrap;
  }

  .top-nav-mobile-brand strong {
    color: var(--color-primary-800);
    font-weight: 650;
  }

  .top-nav-mobile-brand:hover {
    color: var(--ink);
    text-decoration: none;
  }

  .top-nav-actions {
    justify-content: flex-start;
    padding: 0 0 2px;
  }

  .top-nav-button {
    min-height: 36px;
    padding: 0 11px;
  }

  .profile-toggle {
    grid-template-columns: 24px 14px;
    max-width: none;
    min-height: 44px;
    padding: 0 9px;
  }

  .profile-toggle-copy {
    display: none;
  }

  .profile-popover {
    right: -2px;
  }

  .flash-region {
    top: calc(env(safe-area-inset-top, 0px) + 86px);
    right: calc(env(safe-area-inset-right, 0px) + 12px);
    left: calc(env(safe-area-inset-left, 0px) + 12px);
    width: auto;
  }

  .auth-login-shell .flash-region {
    top: calc(env(safe-area-inset-top, 0px) + 12px);
  }

  .flash-notification {
    grid-template-columns: 34px minmax(0, 1fr) 30px;
    gap: 10px;
    min-height: 68px;
    padding: 12px 10px 15px;
  }

  .flash-icon {
    width: 34px;
    height: 34px;
  }

  .flash-icon svg {
    width: 19px;
    height: 19px;
  }

  .flash-dismiss {
    width: 30px;
    min-height: 30px;
  }

  .error-layout {
    min-height: calc(100svh - 160px);
    place-items: start stretch;
    padding: var(--space-5) 0;
  }

  .error-card {
    padding: 24px 18px;
  }

  .error-card h1 {
    max-width: none;
    font-size: var(--page-heading-size);
  }

  .error-message {
    font-size: var(--text-base);
  }

  .error-reference {
    grid-template-columns: 1fr;
  }

  .error-actions {
    display: grid;
  }

  .signout-confirmation {
    align-items: end;
    padding: 14px;
  }

  .signout-dialog {
    width: 100%;
    gap: 16px;
    padding: 22px 18px;
    border-radius: var(--radius-lg);
  }

  .signout-dialog-copy h2 {
    font-size: 28px;
  }

  .signout-dialog-actions {
    grid-template-columns: 1fr;
  }

  .signout-cancel-action {
    width: 100%;
    min-width: 0;
  }

  .release-notes-dialog {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    left: 12px;
    width: auto;
  }

  .release-notes-panel {
    max-height: calc(100dvh - 24px);
    gap: 14px;
    padding: 18px;
  }

  .release-notes-header {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    padding-right: 36px;
  }

  .release-notes-icon {
    width: 44px;
    height: 44px;
  }

  .release-notes-header h2 {
    font-size: 22px;
  }

  .release-notes-sections {
    grid-template-columns: 1fr;
  }

  .release-notes-actions,
  .release-notes-primary {
    width: 100%;
  }

  .release-notes-actions {
    bottom: -18px;
    margin: 2px -18px -18px;
    padding: 12px 18px 18px;
  }

  .sidebar {
    transform: translateX(-104%);
  }

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

  .mobile-nav-toggle {
    position: static;
    grid-area: menu;
    display: inline-grid;
    width: 44px;
    min-height: 44px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 250, 244, 0.9);
    color: var(--color-primary-800);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(8px);
  }

  .mobile-nav-toggle:hover,
  .mobile-nav-toggle:focus-visible {
    background: var(--color-primary-50);
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(34, 25, 20, 0.18);
    border: 0;
    border-radius: 0;
    min-height: 100vh;
    padding: 0;
  }

  .nav-mobile-open .nav-backdrop {
    display: block;
  }

  .sidebar-toggle {
    right: 14px;
    top: 18px;
    transform: none;
  }

  .nav-collapsed .sidebar {
    width: var(--sidebar-width);
    padding: 22px 16px 16px;
  }

  .nav-collapsed .brand-title,
  .nav-collapsed .side-nav-link span,
  .nav-collapsed .sidebar-user span,
  .nav-collapsed .sidebar-signout span,
  .nav-collapsed .sidebar-version span {
    display: inline;
  }

  .nav-collapsed .sidebar-brand {
    width: auto;
    min-height: auto;
    justify-content: flex-start;
    background: transparent;
  }

  .nav-collapsed .sidebar-brand::before {
    content: none;
  }

  .nav-collapsed .side-nav-link,
  .nav-collapsed .sidebar-user,
  .nav-collapsed .sidebar-signout {
    width: 100%;
  }

  .nav-collapsed .side-nav-link {
    grid-template-columns: 24px minmax(0, 1fr);
    justify-items: start;
    padding: 0 10px;
  }

  .nav-collapsed .sidebar-user,
  .nav-collapsed .sidebar-signout,
  .nav-collapsed .sidebar-version {
    grid-template-columns: 32px minmax(0, 1fr);
    justify-items: start;
    padding: 0 10px;
  }

  .nav-collapsed .sidebar-version {
    width: 100%;
    justify-content: center;
  }

  .nav-collapsed .sidebar-footer {
    margin: 0 -16px -16px;
    padding: 16px;
  }

  .nav-collapsed .side-nav-link::before,
  .nav-collapsed .side-nav-link::after {
    display: none;
  }

  .nav-tooltip {
    display: none;
  }

  .app-loader {
    padding: 18px;
  }

  .app-loader-panel {
    width: min(320px, calc(100vw - 32px));
    padding: 26px 22px;
  }

  .app-loader-skeleton {
    display: none;
  }

  .role-select-layout {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 18px 0 32px;
  }

  .role-select-intro {
    gap: 10px;
  }

  .role-select-intro .muted {
    font-size: var(--text-base);
  }

  .role-memory-banner {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .role-memory-banner button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .role-select-card {
    padding: 18px;
  }

  .role-select-card-header {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .role-select-mark {
    width: 46px;
    height: 46px;
  }

  .role-select-card-header h2 {
    font-size: 28px;
  }

  .role-option-button {
    grid-template-columns: 40px minmax(0, 1fr) 18px;
    min-height: 82px;
  }

  .role-option-icon {
    width: 40px;
    height: 40px;
  }

  .role-option-meta {
    grid-column: auto;
    align-self: center;
  }

  .role-preference-panel {
    display: grid;
  }

  .role-clear-preference {
    justify-self: start;
  }

  .with-sidebar .page,
  .nav-collapsed .page {
    width: min(var(--container-width), calc(100vw - 32px));
    margin: var(--space-6) auto var(--space-8);
  }

  .auth-topbar {
    gap: 10px;
    padding: 18px;
  }

  .auth-login-shell .page {
    min-height: 100svh;
  }

  .auth-login-shell .messages {
    margin-top: 16px;
  }

  .login-canvas {
    min-height: 100svh;
    padding: 18px 16px 28px;
  }

  .login-canvas::before {
    inset: 8px;
    border-radius: 14px;
  }

  .login-card {
    padding: 26px 18px;
  }

  .login-card-header {
    gap: 10px;
  }

  .login-card-header h1 {
    font-size: var(--page-heading-size);
  }

  .login-actions {
    margin-top: 28px;
  }

  .login-provider-button {
    min-height: 52px;
  }

  .login-divider {
    margin: 28px 0 20px;
  }

  .login-card-footer {
    display: grid;
    gap: 6px;
    margin-top: 28px;
  }

  .login-card-footer span + span::before {
    display: none;
  }

  .dashboard-home {
    gap: 22px;
  }

  .dashboard-hero,
  .dashboard-alert-grid,
  .dashboard-operation-stack,
  .dashboard-budget-visual {
    grid-template-columns: 1fr;
  }

  .dashboard-hero-copy h1 {
    font-size: var(--page-heading-size);
  }

  .dashboard-hero-copy .muted {
    font-size: var(--text-base);
  }

  .dashboard-metric-grid,
  .dashboard-count-grid,
  .dashboard-workbench-grid,
  .dashboard-record-grid,
  .project-flow-summary-grid,
  .project-flow-project-snapshot,
  .project-flow-phase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-workbench-card-wide {
    grid-column: span 2;
  }

  .project-flow-hero,
  .project-flow-columns {
    grid-template-columns: 1fr;
  }

  .project-flow-overview-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-flow-hero-card {
    max-width: none;
  }

  .project-flow-phase-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-flow-phase-actions {
    justify-content: flex-start;
  }

  .project-flow-task-list a {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .project-flow-task-list small {
    white-space: normal;
  }

  .dashboard-metric-card {
    min-height: 136px;
    padding: var(--space-4);
  }

  .dashboard-metric-card strong {
    font-size: 32px;
  }

  .dashboard-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .dashboard-section-heading h2 {
    font-size: 26px;
  }

  .dashboard-view-grid,
  .dashboard-priority-alerts .alert-list {
    grid-template-columns: 1fr;
  }

  .dashboard-view-card {
    min-height: 64px;
    padding: 0 var(--space-4);
  }

  .dashboard-workbench-card {
    min-height: 118px;
    padding: var(--space-4);
  }

  .dashboard-sprint-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .dashboard-budget-ring {
    width: 132px;
  }

  .dashboard-budget-details div {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .admin-user-form-grid,
  .admin-role-group .checkbox-list {
    grid-template-columns: 1fr;
  }

  .two-column,
  .metric-grid,
  .record-grid,
  .quick-link-grid,
  .filter-bar,
  .split-row,
  .detail-grid,
  .roadmap-item {
    grid-template-columns: 1fr;
  }

  .action-header {
    flex-direction: column;
  }

  .detail-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-record-row {
    grid-template-columns: 1fr;
  }

  .detail-record-grid .detail-record-row dt {
    border-right: 0;
    border-bottom: 1px solid rgba(216, 208, 200, 0.62);
  }

  .operating-form-actions {
    justify-content: stretch;
  }

  .operating-form-actions .primary-action-button {
    width: 100%;
  }

  .owner-multiselect-panel {
    position: static;
    margin-top: var(--space-2);
  }

  .owner-multiselect-options {
    max-height: 220px;
  }

  .record-controls-header {
    flex-direction: column;
  }

  .record-filter-form,
  .record-saved-region {
    grid-template-columns: 1fr;
  }

  .record-search-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

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

  .record-search-control,
  .record-filter-actions {
    grid-column: 1 / -1;
  }

  .record-filter-actions {
    justify-content: stretch;
    min-width: 0;
    padding-top: 0;
  }

  .record-filter-actions button,
  .record-filter-actions .secondary-link {
    width: 100%;
  }

  .record-saved-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .record-saved-heading > div,
  .record-save-card > div {
    display: grid;
    gap: 2px;
  }

  .record-save-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    margin-left: 0;
  }

  .record-save-form button {
    width: auto;
  }

  .record-search-dialog {
    right: 0;
    width: min(100%, calc(100vw - 32px));
    max-height: min(320px, 56vh);
  }

  .weekly-report-summary-row {
    --weekly-report-summary-height: auto;
  }

  .weekly-report-alerts-panel {
    height: auto;
    max-height: none;
  }

  .weekly-report-alerts-panel .alert-list {
    max-height: min(460px, 64vh);
  }

  .weekly-report-hero,
  .weekly-report-progress-card > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }

  .weekly-report-mode-card {
    justify-items: start;
    width: 100%;
  }

  .audit-heading,
  .audit-entry-topline,
  .audit-entry-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .audit-change-grid,
  .audit-value-card dl {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  :root {
    --page-heading-size: 19px;
  }

  .dashboard-metric-grid,
  .dashboard-workbench-grid,
  .project-flow-summary-grid,
  .project-flow-project-snapshot,
  .project-flow-phase-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-workbench-card-wide {
    grid-column: span 1;
  }

  .project-flow-hero-card,
  .project-flow-overview,
  .project-flow-phase-detail,
  .project-flow-node {
    padding: var(--space-4);
  }

  .project-flow-sequence {
    align-items: stretch;
    flex-direction: column;
  }

  .project-flow-sequence > svg {
    transform: rotate(90deg);
    align-self: center;
  }

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

  .record-filter-grid {
    grid-template-columns: 1fr;
  }

  .record-search-control,
  .record-filter-actions {
    grid-column: 1;
  }

  .dashboard-hero-copy h1 {
    font-size: var(--page-heading-size);
  }

  .dashboard-metric-card {
    min-height: 124px;
  }

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

  .dashboard-sprint-row::before,
  .dashboard-sprint-row span {
    grid-column: 1;
  }

  .dashboard-sprint-row strong {
    grid-row: auto;
  }

  .subtask-id-title-fields,
  .task-subtask-meta {
    grid-template-columns: 1fr;
  }

  .task-subtask-card-actions,
  .task-subtask-date-form {
    align-items: stretch;
  }

  .task-subtask-date-form,
  .task-subtask-date-form label,
  .task-subtask-card-actions .secondary-action-button,
  .task-subtask-card-actions .danger-action-button {
    width: 100%;
  }

  .audit-timeline::before,
  .audit-entry-marker {
    display: none;
  }

  .audit-entry {
    grid-template-columns: 1fr;
  }

  .audit-entry-body {
    padding: 12px;
  }
}
