/* ============================================
   DesignFlow AI — Design Tokens
   Imported from Wealthsimple Design System 2025
   ============================================ */

:root {
  /* ---- Neutrals ---- */
  --neutral-black: #181716;
  --neutral-dune: #32302f;
  --neutral-dark-grey: #615e5c;
  --neutral-grey: #94908d;
  --neutral-dark-silver: #a9a6a4;
  --neutral-silver: #bfbebe;
  --neutral-platinum: #e4e2e1;
  --neutral-white-smoke: #fcfcfc;
  --neutral-white: #ffffff;

  /* ---- Red ---- */
  --red-800: #411e1a;
  --red-700: #60241c;
  --red-600: #8f2e1f;
  --red-500: #bf3722;
  --red-400: #f76b5a;
  --red-300: #f89789;
  --red-200: #f9b4a9;
  --red-100: #fbe4de;

  /* ---- Gold ---- */
  --gold-800: #463b33;
  --gold-700: #763d16;
  --gold-600: #bb6e3d;
  --gold-500: #e29c57;
  --gold-400: #f9a471;
  --gold-300: #fceee5;
  --gold-200: #e9e3de;
  --gold-100: #f7f6f2;

  /* ---- Green ---- */
  --green-800: #243519;
  --green-700: #364d27;
  --green-600: #486635;
  --green-500: #5c8145;
  --green-400: #7b9b54;
  --green-300: #99b56e;
  --green-200: #b3d088;
  --green-100: #d5eab8;

  /* ---- Vibrant Green ---- */
  --vibrant-green-800: #39492c;
  --vibrant-green-700: #426120;
  --vibrant-green-600: #4c7a15;
  --vibrant-green-500: #62a215;
  --vibrant-green-400: #97c75c;
  --vibrant-green-300: #acd37d;
  --vibrant-green-200: #cce5ad;
  --vibrant-green-100: #ebf8de;

  /* ---- Blue ---- */
  --blue-800: #24333d;
  --blue-700: #104b71;
  --blue-600: #196ea4;
  --blue-500: #1e94dc;
  --blue-400: #4ba9e3;
  --blue-300: #78bfea;
  --blue-200: #a5d4f1;
  --blue-100: #dde9f1;

  /* ---- Purple ---- */
  --purple-800: #3c2a3f;
  --purple-700: #573e5b;
  --purple-600: #735378;
  --purple-500: #916a96;
  --purple-400: #ac82b2;
  --purple-300: #c0a1c5;
  --purple-200: #d0b9d3;
  --purple-100: #dccade;

  /* ---- Steel Blue ---- */
  --steel-blue-800: #51606c;
  --steel-blue-700: #677987;
  --steel-blue-600: #7d94a4;
  --steel-blue-500: #95afc2;
  --steel-blue-400: #a5bdce;
  --steel-blue-300: #b4cada;
  --steel-blue-200: #c7d7e3;
  --steel-blue-100: #d5e1ea;

  /* ---- Pink ---- */
  --pink-800: #3b232e;
  --pink-700: #522d41;
  --pink-600: #730046;
  --pink-500: #965876;
  --pink-400: #b27291;
  --pink-300: #e495cb;
  --pink-200: #ecb7dc;
  --pink-100: #f4d9ed;

  /* ---- Alpha (semi-transparent) ---- */
  --alpha-5: #32302f0d;
  --alpha-3: #32302f08;
  --alpha-white-smoke-12: #fcfcfc1f;
  --alpha-white-smoke-5: #fcfcfc0d;
  --alpha-white-smoke-3: #fcfcfc08;

  /* ---- Semantic Colours (for DesignFlow status indicators) ---- */
  --status-healthy: var(--green-500);         /* 50-75% utilization */
  --status-at-capacity: var(--gold-500);      /* 76-90% utilization */
  --status-overloaded: var(--red-500);        /* >90% utilization */
  --status-under-utilized: var(--blue-500);   /* <50% utilization */

  /* ---- Typography (from Figma) ---- */
  /* Wealthsimple uses Futura. Format: size / line-height / letter-spacing */
  --font-heading: 'Futura', 'Futura PT', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Futura', 'Futura PT', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family: var(--font-body);

  /* ---- Spacing ---- */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* ---- Border Radius ---- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 32px;

  /* ---- Shadows ---- */
  --shadow-sm: 0px 1px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0px 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0px 4px 40px rgba(0, 0, 0, 0.05);
}

/* ============================================
   Global Reset & Base Styles
   ============================================ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  color: var(--neutral-black);
  background-color: var(--neutral-white-smoke);
  line-height: 1.5;
}

/* ============================================
   Typography — from Wealthsimple Figma
   Font: Futura (Demi Bold = headings, Book = body, Heavy = currency)
   Format in comments: size / line-height / letter-spacing
   ============================================ */

/* Headings — Futura Demi Bold */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--neutral-black);
}

/* H1: 22/29/1 */
h1 {
  font-size: 22px;
  line-height: 29px;
  letter-spacing: 1px;
}

/* H2: 20/27/0.25 */
h2 {
  font-size: 20px;
  line-height: 27px;
  letter-spacing: 0.25px;
}

/* H3: 16/21/0.5 */
h3 {
  font-size: 16px;
  line-height: 21px;
  letter-spacing: 0.5px;
}

/* H4: 14/19/0.5 */
h4 {
  font-size: 14px;
  line-height: 19px;
  letter-spacing: 0.5px;
}

/* H5: 12/16/0.5 */
h5 {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.5px;
}

/* H6: 11/15/1.5 — uppercase */
h6 {
  font-size: 11px;
  line-height: 15px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* H7 (no native element — use .h7 class): 10/13/0.5, Bold */
.h7 {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  line-height: 13px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
}

/* Body — Futura Book */
/* Body Large: 16/26/-0.25 */
p, .body-large {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 26px;
  letter-spacing: -0.25px;
  color: var(--neutral-dark-grey);
}

/* Body Med: 14/20/0 */
.body-med {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0;
}

/* Body Small: 12/20/0 */
small, .body-small {
  font-size: 12px;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--neutral-grey);
}

/* Body X-Small: 10/15/0.5 */
.body-xs {
  font-size: 10px;
  line-height: 15px;
  letter-spacing: 0.5px;
}

/* Link: 12/16/0.25, underlined */
a, .link {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.25px;
  text-decoration: underline;
  color: var(--neutral-black);
}

/* Currency — Futura Heavy */
/* $ X-Large: 36/46/1 */
.currency-xl {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 900;
  line-height: 46px;
  letter-spacing: 1px;
  color: var(--neutral-black);
}

/* $ Large: 20/25/1 */
.currency-lg {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 900;
  line-height: 25px;
  letter-spacing: 1px;
  color: var(--neutral-black);
}

/* $ Med: 16/20/0.5 */
.currency-md {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 900;
  line-height: 20px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
}

/* $ Small: 14/18/0.5 */
.currency-sm {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 900;
  line-height: 18px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
}

/* $ X-Small: 10/10/0.5 */
.currency-xs {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 900;
  line-height: 10px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
}

/* ============================================
   Buttons — from Wealthsimple Figma
   Figma: https://www.figma.com/design/lvBuF3xnQ7PH82rCuHllzX/?node-id=20-1194
   ============================================ */

/* Base button — medium size (default) */
/* Figma: button/med — 16/21/0, Futura Demi Bold, height 48, padding 12px 24px, radius 32 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 48px;
  padding: 12px 24px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 21px;
  letter-spacing: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-2xl);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  pointer-events: none;
}

/* ---- Sizes ---- */

/* Large: 18px, height 60, padding 12px 24px */
.btn-lg {
  height: 60px;
  font-size: 18px;
  line-height: normal;
}

/* Small: 16/20/0, auto height, padding 5px 18px */
.btn-sm {
  height: auto;
  padding: 5px 18px;
  font-size: 16px;
  line-height: 20px;
}

/* Icon button — large: 32x32, padding 8px, radius 24 */
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 8px;
  border-radius: 24px;
}

/* Icon button — small: 24x24 */
.btn-icon.btn-sm {
  width: 24px;
  height: 24px;
  padding: 4px;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

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

/* ---- Variants ---- */

/* Primary: bg #32302f (dune), text #fcfcfc (white smoke) */
.btn-primary {
  background-color: var(--neutral-dune);
  color: var(--neutral-white-smoke);
  border-color: transparent;
}

.btn-primary:hover {
  background-color: var(--neutral-black);
}

.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
  background-color: rgba(50, 48, 47, 0.03);
  color: var(--neutral-grey);
}

/* Secondary: bg white, border #e4e2e1 (platinum), text #32302f (dune) */
.btn-secondary {
  background-color: var(--neutral-white);
  color: var(--neutral-dune);
  border-color: var(--neutral-platinum);
}

.btn-secondary:hover {
  background-color: var(--neutral-white-smoke);
  border-color: var(--neutral-silver);
}

.btn-secondary:disabled,
.btn-secondary[aria-disabled="true"] {
  background-color: rgba(50, 48, 47, 0.03);
  color: var(--neutral-grey);
  border-color: var(--neutral-platinum);
}

/* Tertiary: bg rgba(50,48,47,0.08), text #615e5c (dark grey) */
.btn-tertiary {
  background-color: rgba(50, 48, 47, 0.08);
  color: var(--neutral-dark-grey);
  border-color: transparent;
}

.btn-tertiary:hover {
  background-color: rgba(50, 48, 47, 0.12);
}

.btn-tertiary:disabled,
.btn-tertiary[aria-disabled="true"] {
  background-color: rgba(50, 48, 47, 0.03);
  color: var(--neutral-grey);
}

/* Warning: bg #fbe4de (red-100), text #bf3722 (red-500) */
.btn-warning {
  background-color: var(--red-100);
  color: var(--red-500);
  border-color: transparent;
}

.btn-warning:hover {
  background-color: var(--red-200);
}

/* ---- Link button ---- */
/* Figma: 14/19/0.5, Futura Demi Bold, with arrow icon */
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  height: auto;
  background: none;
  border: none;
  border-radius: 0;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 19px;
  letter-spacing: 0.5px;
  color: var(--neutral-dune);
  cursor: pointer;
  text-decoration: none;
}

.btn-link:hover {
  opacity: 0.7;
}

.btn-link::after {
  content: "\2192";
  font-size: 14px;
}

/* ============================================
   Cards
   ============================================ */

.card {
  background-color: var(--neutral-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.card-elevated {
  box-shadow: var(--shadow-md);
}

/* ============================================
   Status Badges
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-2xl);
}

.badge-healthy {
  background-color: var(--green-100);
  color: var(--green-700);
}

.badge-at-capacity {
  background-color: var(--gold-100);
  color: var(--gold-700);
}

.badge-overloaded {
  background-color: var(--red-100);
  color: var(--red-700);
}

.badge-under-utilized {
  background-color: var(--blue-100);
  color: var(--blue-700);
}

/* ============================================
   Form Inputs (legacy — simple input)
   ============================================ */

.input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-family);
  font-size: 1rem;
  color: var(--neutral-black);
  background-color: var(--neutral-white);
  border: 1px solid var(--neutral-platinum);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(30, 148, 220, 0.15);
}

.input::placeholder {
  color: var(--neutral-dark-silver);
}

textarea.input {
  min-height: 100px;
  resize: vertical;
}

/* ============================================
   Wealthsimple Input Field — Floating Label
   Figma: node-id=22-2483
   States: empty, default, active, error, disabled
   ============================================ */

/* Wrapper — holds the field box + optional helper text */
.ws-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

/* The visible input box */
.ws-field__box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 60px;
  padding: 10px 14px 10px 18px;
  background-color: var(--neutral-white);
  border: 1px solid var(--neutral-platinum);
  border-radius: 16px;
  cursor: text;
  transition: border-color 0.2s ease;
}

/* Inner container for label + value stacking */
.ws-field__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
  height: 100%;
}

/* Floating label — resting position (centered, 16px) */
.ws-field__label {
  position: absolute;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 21px;
  letter-spacing: 0.5px;
  color: var(--neutral-dark-grey);
  pointer-events: none;
  transition: all 0.15s ease;
}

/* Floating label — raised position (top, 12px) */
.ws-field.has-value .ws-field__label,
.ws-field.is-active .ws-field__label {
  top: 10px;
  transform: translateY(0);
  font-size: 12px;
  line-height: 16px;
}

/* The actual <input> element — invisible until has value/focus */
.ws-field__input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 21px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
  padding: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* Show the input text when field has value or is focused */
.ws-field.has-value .ws-field__input,
.ws-field.is-active .ws-field__input {
  opacity: 1;
  margin-top: 20px;
}

.ws-field__input::placeholder {
  color: transparent;
}

/* Optional clear button (right side) */
.ws-field__clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background-color: rgba(50, 48, 47, 0.08);
  border: none;
  border-radius: 24px;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
}

.ws-field__clear svg {
  width: 12px;
  height: 12px;
  fill: var(--neutral-black);
}

.ws-field.has-value .ws-field__clear {
  display: flex;
}

/* ---- Active state (focused) ---- */
.ws-field.is-active .ws-field__box {
  border-color: var(--neutral-black);
}

/* ---- Error state ---- */
.ws-field.is-error .ws-field__box {
  border-color: var(--red-500);
}

/* ---- Disabled state ---- */
.ws-field.is-disabled .ws-field__box {
  background-color: rgba(50, 48, 47, 0.03);
  border-color: var(--neutral-platinum);
  cursor: not-allowed;
}

.ws-field.is-disabled .ws-field__label {
  color: var(--neutral-grey);
}

.ws-field.is-disabled .ws-field__input {
  color: var(--neutral-grey);
  cursor: not-allowed;
}

/* ---- Helper / Error text ---- */
.ws-field__helper {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 0;
}

.ws-field__helper-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ws-field__helper-icon svg {
  width: 100%;
  height: 100%;
}

.ws-field__helper-text {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
}

/* Show helper text in error state */
.ws-field.is-error .ws-field__helper {
  display: flex;
}

.ws-field.is-error .ws-field__helper-icon svg {
  fill: var(--red-500);
}

.ws-field.is-error .ws-field__helper-text {
  color: var(--red-500);
}

/* ============================================
   Wealthsimple Toast
   Figma: node-id=26-564
   Inline notification pill with icon + text
   ============================================ */

.ws-toast {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 16px;
  border-radius: 16px;
  background-color: var(--blue-100);
}

.ws-toast__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.ws-toast__icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.ws-toast__text {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--blue-600);
}

/* Variant: success (green) */
.ws-toast--success {
  background-color: var(--green-100);
}

.ws-toast--success .ws-toast__text {
  color: var(--green-700);
}

.ws-toast--success .ws-toast__icon svg {
  fill: var(--green-700);
}

/* Variant: warning (gold) */
.ws-toast--warning {
  background-color: var(--gold-100);
}

.ws-toast--warning .ws-toast__text {
  color: var(--gold-700);
}

.ws-toast--warning .ws-toast__icon svg {
  fill: var(--gold-700);
}

/* Variant: error (red) */
.ws-toast--error {
  background-color: var(--red-100);
}

.ws-toast--error .ws-toast__text {
  color: var(--red-700);
}

.ws-toast--error .ws-toast__icon svg {
  fill: var(--red-700);
}

/* ============================================
   Wealthsimple Textarea — Floating Label
   Figma: node-id=26-692
   Same design language as ws-field, multi-line
   States: empty, default, active, error, disabled
   ============================================ */

.ws-textarea {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.ws-textarea__box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 120px;
  padding: 10px 18px;
  background-color: var(--neutral-white);
  border: 1px solid var(--neutral-platinum);
  border-radius: 16px;
  cursor: text;
  transition: border-color 0.2s ease;
}

.ws-textarea__label {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 21px;
  letter-spacing: 0.5px;
  color: var(--neutral-dark-grey);
  pointer-events: none;
  transition: font-size 0.15s ease, line-height 0.15s ease;
}

/* Label shrinks when active or has value */
.ws-textarea.has-value .ws-textarea__label,
.ws-textarea.is-active .ws-textarea__label {
  font-size: 12px;
  line-height: 16px;
}

.ws-textarea__input {
  width: 100%;
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 21px;
  letter-spacing: 0;
  color: var(--neutral-black);
  padding: 0;
  margin: 0;
  resize: vertical;
  min-height: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ws-textarea.has-value .ws-textarea__input,
.ws-textarea.is-active .ws-textarea__input {
  opacity: 1;
  margin-top: 4px;
  min-height: 63px;
}

.ws-textarea__input::placeholder {
  color: transparent;
}

/* Character count */
.ws-textarea__count {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0;
  color: var(--neutral-grey);
  text-align: right;
  padding-top: 4px;
}

/* ---- Active state ---- */
.ws-textarea.is-active .ws-textarea__box {
  border-color: var(--neutral-black);
}

/* ---- Error state ---- */
.ws-textarea.is-error .ws-textarea__box {
  border-color: var(--red-500);
}

.ws-textarea__helper {
  display: none;
  align-items: center;
  gap: 8px;
}

.ws-textarea__helper-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ws-textarea__helper-icon svg {
  width: 100%;
  height: 100%;
}

.ws-textarea__helper-text {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
}

.ws-textarea.is-error .ws-textarea__helper {
  display: flex;
}

.ws-textarea.is-error .ws-textarea__helper-icon svg {
  fill: var(--red-500);
}

.ws-textarea.is-error .ws-textarea__helper-text {
  color: var(--red-500);
}

/* ---- Disabled state ---- */
.ws-textarea.is-disabled .ws-textarea__box {
  background-color: rgba(50, 48, 47, 0.03);
  border-color: var(--neutral-platinum);
  cursor: not-allowed;
}

.ws-textarea.is-disabled .ws-textarea__label {
  color: var(--neutral-grey);
}

.ws-textarea.is-disabled .ws-textarea__input {
  color: var(--neutral-grey);
  cursor: not-allowed;
  resize: none;
}

/* ============================================
   Modal / Dialog
   Wealthsimple-style centered dialog overlay.
   Uses backdrop blur. Trap focus for accessibility.
   ============================================ */

/* Backdrop overlay */
.ws-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(24, 23, 22, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  padding: 24px;
}

.ws-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* Modal panel */
.ws-modal {
  background-color: var(--neutral-white);
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  padding: 32px;
  box-shadow: 0px 8px 40px rgba(0, 0, 0, 0.12);
  transform: translateY(8px);
  transition: transform 0.2s ease;
}

.ws-modal-backdrop.is-open .ws-modal {
  transform: translateY(0);
}

.ws-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.ws-modal__title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  line-height: 27px;
  letter-spacing: 0.25px;
  color: var(--neutral-black);
}

.ws-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background-color: rgba(50, 48, 47, 0.08);
  border: none;
  border-radius: 32px;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s ease;
}

.ws-modal__close:hover {
  background-color: rgba(50, 48, 47, 0.14);
}

.ws-modal__close svg {
  width: 14px;
  height: 14px;
  fill: var(--neutral-black);
}

.ws-modal__body {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--neutral-dark-grey);
  margin-bottom: 24px;
}

.ws-modal__actions {
  display: flex;
  gap: 12px;
}

.ws-modal__actions .btn {
  flex: 1;
}

/* --- Form inputs --- */
.ws-input {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--neutral-light-grey);
  border-radius: 8px;
  background: var(--white);
  color: var(--neutral-dark-grey);
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.ws-input:focus {
  outline: none;
  border-color: var(--blue-500, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
.ws-input::placeholder {
  color: var(--neutral-grey);
}
select.ws-input {
  cursor: pointer;
  appearance: auto;
}

/* ============================================
   Radio Button
   Wealthsimple-style custom radio with label.
   Accessible, keyboard navigable.
   ============================================ */

.ws-radio {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  position: relative;
}

.ws-radio__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ws-radio__circle {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 2px solid var(--neutral-platinum);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease;
  margin-top: 1px;
}

.ws-radio__circle::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--neutral-dune);
  transform: scale(0);
  transition: transform 0.15s ease;
}

/* Checked state */
.ws-radio__input:checked + .ws-radio__circle {
  border-color: var(--neutral-dune);
}

.ws-radio__input:checked + .ws-radio__circle::after {
  transform: scale(1);
}

/* Focus visible */
.ws-radio__input:focus-visible + .ws-radio__circle {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

/* Hover */
.ws-radio:hover .ws-radio__circle {
  border-color: var(--neutral-dark-silver);
}

.ws-radio__input:checked + .ws-radio__circle:hover {
  border-color: var(--neutral-black);
}

/* Disabled */
.ws-radio.is-disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ws-radio.is-disabled .ws-radio__circle {
  border-color: var(--neutral-platinum);
}

/* Label text */
.ws-radio__label {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 21px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
}

.ws-radio__desc {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--neutral-dark-grey);
  margin-top: 2px;
}

/* Radio group */
.ws-radio-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ws-radio-group__label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: var(--neutral-dark-grey);
  text-transform: uppercase;
}

/* ============================================
   Progress / Capacity Bar
   Horizontal bar showing utilization level.
   Color-coded by status thresholds.
   ============================================ */

.ws-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.ws-progress__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.ws-progress__label {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 19px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
}

.ws-progress__value {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 19px;
  letter-spacing: 0.5px;
  color: var(--neutral-dark-grey);
}

.ws-progress__track {
  width: 100%;
  height: 8px;
  background-color: var(--neutral-platinum);
  border-radius: 4px;
  overflow: hidden;
}

.ws-progress__fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
  background-color: var(--status-healthy);
}

/* Status colors */
.ws-progress--healthy .ws-progress__fill {
  background-color: var(--status-healthy);
}

.ws-progress--at-capacity .ws-progress__fill {
  background-color: var(--status-at-capacity);
}

.ws-progress--overloaded .ws-progress__fill {
  background-color: var(--status-overloaded);
}

.ws-progress--under-utilized .ws-progress__fill {
  background-color: var(--status-under-utilized);
}

.ws-progress__meta {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0;
  color: var(--neutral-grey);
}

/* ============================================
   Alert Banner
   Full-width alert for bottleneck warnings.
   Severity variants: info, warning, critical.
   ============================================ */

.ws-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 16px;
  width: 100%;
}

.ws-alert__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.ws-alert__icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.ws-alert__content {
  flex: 1;
  min-width: 0;
}

.ws-alert__title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 19px;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.ws-alert__desc {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
}

.ws-alert__action {
  flex-shrink: 0;
  align-self: center;
}

/* Info variant (blue) */
.ws-alert--info {
  background-color: var(--blue-100);
}

.ws-alert--info .ws-alert__icon svg {
  fill: var(--blue-600);
}

.ws-alert--info .ws-alert__title {
  color: var(--blue-700);
}

.ws-alert--info .ws-alert__desc {
  color: var(--blue-600);
}

/* Warning variant (gold) */
.ws-alert--warning {
  background-color: var(--gold-100);
}

.ws-alert--warning .ws-alert__icon svg {
  fill: var(--gold-600);
}

.ws-alert--warning .ws-alert__title {
  color: var(--gold-700);
}

.ws-alert--warning .ws-alert__desc {
  color: var(--gold-600);
}

/* Critical variant (red) — used for bottleneck alerts */
.ws-alert--critical {
  background-color: var(--red-100);
}

.ws-alert--critical .ws-alert__icon svg {
  fill: var(--red-500);
}

.ws-alert--critical .ws-alert__title {
  color: var(--red-700);
}

.ws-alert--critical .ws-alert__desc {
  color: var(--red-600);
}

/* ============================================
   Breadcrumb
   Navigation trail for multi-screen flows.
   ============================================ */

.ws-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ws-breadcrumb__item {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--neutral-grey);
  text-decoration: none;
}

.ws-breadcrumb__item:hover {
  color: var(--neutral-dark-grey);
  text-decoration: underline;
}

/* Current (last) item — not a link */
.ws-breadcrumb__item[aria-current="page"] {
  color: var(--neutral-black);
  font-weight: 700;
  font-family: var(--font-heading);
  pointer-events: none;
  text-decoration: none;
}

.ws-breadcrumb__sep {
  font-size: 12px;
  color: var(--neutral-silver);
  user-select: none;
}

/* ============================================
   Tooltip
   Small floating label on hover/focus.
   Position via utility classes.
   ============================================ */

.ws-tooltip-wrap {
  position: relative;
  display: inline-flex;
}

.ws-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--neutral-dune);
  color: var(--neutral-white-smoke);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 100;
}

/* Arrow */
.ws-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--neutral-dune);
}

/* Show on hover/focus */
.ws-tooltip-wrap:hover .ws-tooltip,
.ws-tooltip-wrap:focus-within .ws-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Multi-line variant */
.ws-tooltip--wide {
  white-space: normal;
  width: 240px;
  text-align: left;
}

/* Bottom position */
.ws-tooltip--bottom {
  bottom: auto;
  top: calc(100% + 8px);
}

.ws-tooltip--bottom::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--neutral-dune);
}

/* ============================================
   Avatar
   Circular user photo or initials fallback.
   Sizes: sm (24px), md (32px), lg (40px).
   ============================================ */

.ws-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  background-color: var(--neutral-platinum);
  color: var(--neutral-dark-grey);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
}

.ws-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ws-avatar--sm {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.ws-avatar--lg {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.ws-avatar--xl {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

/* Avatar group (stacked) */
.ws-avatar-group {
  display: flex;
  align-items: center;
}

.ws-avatar-group .ws-avatar {
  border: 2px solid var(--neutral-white);
  margin-left: -8px;
}

.ws-avatar-group .ws-avatar:first-child {
  margin-left: 0;
}

/* ============================================
   Chip / Tag
   Small label for complexity flags, categories.
   ============================================ */

.ws-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 32px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Default (neutral) */
.ws-chip--neutral {
  background-color: rgba(50, 48, 47, 0.08);
  color: var(--neutral-dark-grey);
}

/* Info (blue) */
.ws-chip--info {
  background-color: var(--blue-100);
  color: var(--blue-700);
}

/* Success (green) */
.ws-chip--success {
  background-color: var(--green-100);
  color: var(--green-700);
}

/* Warning (gold) */
.ws-chip--warning {
  background-color: var(--gold-100);
  color: var(--gold-700);
}

/* Danger (red) */
.ws-chip--danger {
  background-color: var(--red-100);
  color: var(--red-700);
}

/* With icon */
.ws-chip__icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.ws-chip__icon svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* ============================================
   Top Navigation Bar
   Global header with logo, sprint indicator,
   nav links, and user avatar.
   ============================================ */

.ws-topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  background-color: var(--neutral-white);
  border-bottom: 1px solid var(--neutral-platinum);
  position: sticky;
  top: 0;
  z-index: 900;
}

.ws-topnav__left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.ws-topnav__logo {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 21px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
  text-decoration: none;
}

.ws-topnav__sprint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background-color: rgba(50, 48, 47, 0.08);
  border-radius: 32px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: var(--neutral-dark-grey);
}

.ws-topnav__sprint-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--green-500);
}

.ws-topnav__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ws-topnav__link {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 19px;
  letter-spacing: 0.5px;
  color: var(--neutral-grey);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 32px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ws-topnav__link:hover {
  background-color: rgba(50, 48, 47, 0.06);
  color: var(--neutral-dark-grey);
}

.ws-topnav__link.is-active {
  background-color: rgba(50, 48, 47, 0.08);
  color: var(--neutral-black);
}

.ws-topnav__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ws-topnav__user {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.ws-topnav__user-name {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 19px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
}

/* Mobile responsive */
@media (max-width: 640px) {
  .ws-topnav {
    padding: 0 16px;
    gap: 8px;
  }

  .ws-topnav__nav {
    display: none;
  }

  .ws-topnav__user-name {
    display: none;
  }
}

/* ============================================
   Selectable Option Card
   Card that can be selected (radio-style).
   Used for reallocation options on Screen 3.
   ============================================ */

.ws-option-card {
  position: relative;
  background-color: var(--neutral-white);
  border: 2px solid var(--neutral-platinum);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ws-option-card:hover {
  border-color: var(--neutral-silver);
}

/* Selected state */
.ws-option-card.is-selected {
  border-color: var(--neutral-black);
  box-shadow: var(--shadow-md);
}

/* Hidden radio input */
.ws-option-card__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ws-option-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ws-option-card__title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 21px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
}

/* Radio indicator on card */
.ws-option-card__check {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 2px solid var(--neutral-platinum);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease;
}

.ws-option-card__check::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--neutral-dune);
  transform: scale(0);
  transition: transform 0.15s ease;
}

.ws-option-card.is-selected .ws-option-card__check {
  border-color: var(--neutral-dune);
}

.ws-option-card.is-selected .ws-option-card__check::after {
  transform: scale(1);
}

.ws-option-card__desc {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--neutral-dark-grey);
  margin-bottom: 16px;
}

.ws-option-card__meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ws-option-card__row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.ws-option-card__row-label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: var(--neutral-grey);
  flex-shrink: 0;
  min-width: 72px;
}

.ws-option-card__row-value {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--neutral-dark-grey);
}

/* Focus visible for keyboard nav */
.ws-option-card:has(.ws-option-card__input:focus-visible) {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

/* AI recommendation tag */
.ws-option-card__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 32px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  line-height: 15px;
  letter-spacing: 0.5px;
  background-color: var(--green-100);
  color: var(--green-700);
  margin-bottom: 12px;
}

/* AI loading progress */
.ai-progress {
  background: var(--white);
  border: 1px solid var(--neutral-200, #e5e5e5);
  border-radius: var(--radius-lg, 12px);
  padding: 32px;
  margin-bottom: 24px;
}

.ai-progress__bar-track {
  width: 100%;
  height: 6px;
  background: var(--neutral-100, #f0f0f0);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 24px;
}

.ai-progress__bar-fill {
  width: 0%;
  height: 100%;
  background: var(--blue-500, #3b82f6);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.ai-progress__steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-progress__step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--neutral-grey, #737373);
  transition: color 0.3s ease;
}

.ai-progress__step.is-active {
  color: var(--neutral-dark-grey, #333);
  font-weight: 500;
}

.ai-progress__step.is-complete {
  color: var(--green-700, #15803d);
}

.ai-progress__step-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  background: var(--neutral-100, #f0f0f0);
  transition: background 0.3s ease;
}

.ai-progress__step.is-active .ai-progress__step-icon {
  background: var(--blue-100, #dbeafe);
  color: var(--blue-700, #1d4ed8);
  animation: progress-pulse 1.2s ease-in-out infinite;
}

.ai-progress__step.is-complete .ai-progress__step-icon {
  background: var(--green-100, #dcfce7);
  color: var(--green-700, #15803d);
  animation: none;
}

@keyframes progress-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================
   Utility Classes
   ============================================ */

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

/* ============================================
   Screen Layouts — Dashboard
   ============================================ */

.dashboard-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.dashboard-alert {
  margin-bottom: 24px;
}

.dashboard-layout {
  display: grid;
  gap: 24px;
}

@media (min-width: 900px) {
  .dashboard-layout {
    grid-template-columns: 1fr 280px;
  }
}

/* Section header */
.dashboard-section-header {
  margin-bottom: 20px;
}

.dashboard-section-header h1 {
  margin-bottom: 4px;
}

/* ---- Heatmap ---- */

.heatmap-scroll {
  overflow: visible;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
}

.heatmap {
  min-width: 600px;
}

.heatmap-header {
  display: grid;
  grid-template-columns: 160px repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}

.heatmap-squad-label,
.heatmap-sprint-label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: var(--neutral-grey);
  text-transform: uppercase;
  padding: 8px 12px;
}

.heatmap-sprint-label {
  text-align: center;
}

.heatmap-row {
  display: grid;
  grid-template-columns: 160px repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 6px;
  position: relative;
}

.heatmap-row:hover {
  z-index: 10;
}

/* Squad label cell (left column) */
.heatmap-squad-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 12px;
}

.heatmap-squad-name {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 19px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
}

.heatmap-designer-names {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0;
  color: var(--neutral-grey);
}

/* Heatmap cell (colored) */
.heatmap-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 14px 8px;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.heatmap-cell:hover {
  transform: scale(1.03);
  z-index: 10;
}

.heatmap-cell--clickable {
  cursor: pointer;
}

.heatmap-cell--clickable:hover {
  box-shadow: var(--shadow-md);
}

.heatmap-cell__pct {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: 0.5px;
}

.heatmap-cell__hours {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  line-height: 15px;
  letter-spacing: 0;
  opacity: 0.8;
}

.heatmap-cell__cross-squad {
  font-size: 10px;
  font-weight: 500;
  color: var(--blue-700);
  background: var(--blue-100);
  padding: 1px 6px;
  border-radius: var(--radius-lg);
  margin-top: 2px;
}

.heatmap-cell__pto {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--gold-100);
  color: var(--gold-700);
  padding: 1px 4px;
  border-radius: var(--radius-sm);
  line-height: 14px;
}

/* Heatmap cell status colors */
.heatmap-cell--healthy {
  background-color: var(--green-100);
  color: var(--green-700);
}

.heatmap-cell--at-capacity {
  background-color: var(--gold-100);
  color: var(--gold-700);
}

.heatmap-cell--overloaded {
  background-color: var(--red-100);
  color: var(--red-700);
}

.heatmap-cell--under-utilized {
  background-color: var(--blue-100);
  color: var(--blue-700);
}

/* Heatmap legend */
.heatmap-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.heatmap-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.heatmap-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.heatmap-legend__swatch--healthy { background-color: var(--green-100); }
.heatmap-legend__swatch--at-capacity { background-color: var(--gold-100); }
.heatmap-legend__swatch--overloaded { background-color: var(--red-100); }
.heatmap-legend__swatch--under-utilized { background-color: var(--blue-100); }

/* Heatmap view toggle */
.heatmap-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  background: rgba(50, 48, 47, 0.06);
  border-radius: 8px;
  padding: 3px;
  width: fit-content;
}

.heatmap-toggle__btn {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  color: var(--neutral-grey);
  transition: background-color 0.15s, color 0.15s;
}

.heatmap-toggle__btn:hover {
  color: var(--neutral-dark-grey);
}

.heatmap-toggle__btn.is-active {
  background: var(--neutral-white);
  color: var(--neutral-black);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Designer view left cell */
.heatmap-designer-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.heatmap-designer-cell__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.heatmap-designer-cell__name {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--neutral-black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heatmap-designer-cell__squad {
  font-size: 11px;
  color: var(--neutral-grey);
  white-space: nowrap;
}

/* ---- Sidebar ---- */

.sidebar-card {
  padding: 20px;
  margin-bottom: 16px;
}

.sidebar-card__title {
  font-size: 14px;
  line-height: 19px;
  letter-spacing: 0.5px;
  color: var(--neutral-dark-grey);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.sidebar-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--neutral-platinum);
}

.sidebar-stat:last-of-type {
  border-bottom: none;
}

.sidebar-stat__value {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  line-height: 30px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
}

.sidebar-stat__value--alert {
  color: var(--red-500);
}

.sidebar-stat__label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--neutral-dark-grey);
}

/* Sidebar squad list */
.sidebar-squads {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-squad-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.sidebar-squad-item:hover {
  background-color: var(--neutral-lightest-grey, #f5f5f5);
}

.sidebar-squad-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
}

.sidebar-squad-info__name {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 19px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
}

/* ============================================
   Shared Screen Layout Utilities
   ============================================ */

/* Action bar — bottom of estimation + reallocation screens */
.action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px 0;
}

/* Page container — used by estimation + reallocation */
.screen-page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 24px;
}

/* ============================================
   Screen Layouts — Task Estimation
   ============================================ */

/* ---- Ticket List View (State 1) ---- */

.ticket-list-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.ticket-list-header__left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.ticket-list-header__title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  line-height: 30px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
}

.ticket-list-header__count {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--neutral-grey);
  padding-top: 8px;
}

/* JIRA connected badge */
.jira-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 32px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background-color: var(--green-100);
  color: var(--green-700);
}

.jira-badge svg {
  flex-shrink: 0;
}

/* Filter chips */
.ticket-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.ticket-filter {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--neutral-grey);
  background: none;
  border: 1.5px solid var(--neutral-platinum);
  border-radius: 32px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ticket-filter:hover {
  border-color: var(--neutral-silver);
  color: var(--neutral-dark-grey);
}

.ticket-filter.is-active {
  background-color: var(--neutral-black);
  border-color: var(--neutral-black);
  color: var(--neutral-white);
}

/* Column filter bar */
.column-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.column-filter {
  position: relative;
}

.column-filter__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--neutral-grey);
  background: var(--neutral-white);
  border: 1.5px solid var(--neutral-platinum);
  border-radius: 32px;
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.column-filter__btn:hover {
  border-color: var(--neutral-silver);
  color: var(--neutral-dark-grey);
}

.column-filter__btn svg {
  transition: transform 0.15s ease;
}

.column-filter.is-open .column-filter__btn svg {
  transform: rotate(180deg);
}

.column-filter.has-filter .column-filter__btn {
  border-color: var(--blue-500);
  color: var(--blue-700);
  background-color: var(--blue-100);
}

/* Dropdown */
.column-filter__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 160px;
  background: var(--neutral-white);
  border: 1px solid var(--neutral-platinum);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 100;
  display: none;
}

.column-filter.is-open .column-filter__dropdown {
  display: block;
}

.column-filter__option {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--neutral-dark-grey);
  background: none;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.column-filter__option:hover {
  background-color: rgba(50, 48, 47, 0.04);
}

.column-filter__option.is-active {
  color: var(--blue-700);
  background-color: var(--blue-100);
}

.column-filter__clear {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--neutral-grey);
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 8px;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.column-filter__clear:hover {
  color: var(--neutral-black);
  text-decoration-color: var(--neutral-black);
}

/* Sortable column headers */
.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.sortable-th:hover {
  color: var(--neutral-dark-grey);
}

.sort-icon::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 4px solid var(--neutral-silver);
  position: relative;
  top: -1px;
}

.sortable-th.is-sorted-asc .sort-icon::after {
  border-bottom-color: var(--neutral-black);
}

.sortable-th.is-sorted-desc .sort-icon::after {
  border-bottom: none;
  border-top: 4px solid var(--neutral-black);
}

/* Ticket list table */
.ticket-list-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ticket-list-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.ticket-list-table th {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: var(--neutral-grey);
  text-transform: uppercase;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--neutral-platinum);
  white-space: nowrap;
}

.ticket-list-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--neutral-light-grey, var(--neutral-platinum));
  vertical-align: middle;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 20px;
  color: var(--neutral-black);
}

.ticket-list-row:hover {
  background-color: rgba(50, 48, 47, 0.02);
}

.ticket-list-row[role="link"]:hover {
  background-color: rgba(50, 48, 47, 0.04);
}

/* Ticket ID + title cell */
.ticket-list-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ticket-id {
  font-family: var(--font-mono, 'SF Mono', 'Fira Code', monospace);
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-600);
  letter-spacing: 0.3px;
}

.ticket-list-row[role="link"] .ticket-id {
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s ease;
}

.ticket-list-row[role="link"]:hover .ticket-id {
  text-decoration-color: var(--blue-500);
}

.ticket-title-text {
  font-size: 14px;
  color: var(--neutral-dark-grey);
}

/* Ticket ID + Type row */
.ticket-list-cell__id-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Task type chip (in ticket list) */
.task-type-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--neutral-dark-grey);
  background-color: var(--neutral-light-grey, rgba(50, 48, 47, 0.06));
  white-space: nowrap;
}

/* Epic grouping label */
.epic-label {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--neutral-grey);
  font-style: italic;
}

/* Assignee cell */
.assignee-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assignee-names {
  font-size: 13px;
  color: var(--neutral-dark-grey);
  white-space: nowrap;
}

/* Confidence badge */
.confidence-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 32px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.confidence-badge--high {
  background-color: var(--green-100);
  color: var(--green-700);
}

.confidence-badge--medium {
  background-color: var(--gold-100);
  color: var(--gold-700);
}

.confidence-badge--low {
  background-color: var(--red-100);
  color: var(--red-700);
}

/* JIRA status badges */
.jira-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 32px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.jira-status--in-progress {
  background-color: var(--blue-100);
  color: var(--blue-700);
}

.jira-status--to-do {
  background-color: var(--neutral-platinum);
  color: var(--neutral-dark-grey);
}

.jira-status--in-review {
  background-color: var(--purple-100);
  color: var(--purple-700);
}

.jira-status--done {
  background-color: var(--green-100);
  color: var(--green-700);
}

/* Small button variants */
.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  line-height: 16px;
}

.btn-outline {
  background: none;
  border: 1.5px solid var(--neutral-platinum);
  color: var(--neutral-dark-grey);
  border-radius: 32px;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-outline:hover {
  border-color: var(--neutral-silver);
  color: var(--neutral-black);
}

.btn-review {
  background: var(--gold-100);
  border: 1.5px solid var(--gold-200);
  color: var(--gold-700);
  border-radius: 32px;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-review:hover {
  background-color: var(--gold-200);
}

/* ---- Back button (detail → list) ---- */
.ticket-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--neutral-grey);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
  transition: color 0.15s ease;
}

.ticket-back-btn:hover {
  color: var(--neutral-black);
}

/* JIRA ID in detail header */
.ticket-header__jira-id {
  font-family: var(--font-mono, 'SF Mono', 'Fira Code', monospace);
  font-size: 14px;
  font-weight: 600;
  color: var(--blue-600);
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

/* Mobile ticket list */
@media (max-width: 640px) {
  .ticket-list-table,
  .ticket-list-table thead,
  .ticket-list-table tbody,
  .ticket-list-table tr,
  .ticket-list-table th,
  .ticket-list-table td {
    display: block;
  }

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

  .ticket-list-table td {
    padding: 6px 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .ticket-list-table td::before {
    content: attr(data-label);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--neutral-grey);
    text-transform: uppercase;
    min-width: 80px;
    flex-shrink: 0;
  }

  .ticket-list-table td:first-child::before {
    display: none;
  }

  .ticket-list-table tbody tr {
    padding: 14px 0;
    border-bottom: 1px solid var(--neutral-platinum);
  }

  .ticket-list-header__title {
    font-size: 20px;
  }
}

/* ---- Ticket Detail View (State 2) ---- */

/* Ticket header card */
.ticket-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.ticket-header__main {
  flex: 1;
  min-width: 0;
}

.ticket-header__title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  line-height: 26px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
  margin-bottom: 8px;
}

.ticket-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ticket-header__total {
  text-align: right;
  flex-shrink: 0;
}

.ticket-header__total-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  line-height: 38px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
}

.ticket-header__total-label {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--neutral-grey);
}

/* Ticket description */
.ticket-description {
  margin-bottom: 20px;
}

.ticket-description__label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--neutral-grey);
  margin: 0 0 8px;
}

.ticket-description__text {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 22px;
  color: var(--neutral-black);
  margin: 0;
}

/* Description quality signals */
.desc-signals {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--neutral-light-grey, var(--neutral-platinum));
}

.desc-signals__header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.desc-signals__icon {
  display: flex;
  color: var(--neutral-grey);
}

.desc-signals__title {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--neutral-grey);
}

.desc-signals__score {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 32px;
  letter-spacing: 0.3px;
}

.desc-signals__score--strong {
  background-color: var(--green-100);
  color: var(--green-700);
}

.desc-signals__score--good {
  background-color: var(--gold-100);
  color: var(--gold-700);
}

.desc-signals__score--weak {
  background-color: var(--red-100);
  color: var(--red-700);
}

.desc-signals__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.desc-signals__item {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 18px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.desc-signals__item--positive {
  color: var(--green-700);
}

.desc-signals__item--warning {
  color: var(--gold-700);
}

.desc-signals__item-icon {
  flex-shrink: 0;
  font-size: 12px;
}

/* Single-task estimation card */
.estimation-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 24px;
}

.estimation-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--neutral-light-grey, rgba(50, 48, 47, 0.08));
}

.estimation-card__row:last-child {
  border-bottom: none;
}

.estimation-card__label {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--neutral-dark-grey);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.estimation-card__reasoning {
  padding-top: 16px;
  border-top: 1px solid var(--neutral-light-grey, rgba(50, 48, 47, 0.08));
  margin-top: 4px;
}

.estimation-card__reasoning-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.estimation-card__reasoning-title {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--neutral-grey);
}

.estimation-card__reasoning-text {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 22px;
  color: var(--neutral-black);
  margin: 0;
}

/* ---- Human-in-the-loop: Review banner ---- */
.review-required-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin: 12px 0 4px;
  background-color: var(--gold-100);
  border: 1px solid var(--gold-200);
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 20px;
  color: var(--gold-700);
}

.review-required-banner__icon {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 20px;
}

.review-required-banner__text strong {
  font-weight: 700;
}

/* ---- Human-in-the-loop: Notes textarea ---- */
.estimation-notes {
  padding-top: 16px;
  margin-top: 4px;
}

.estimation-notes__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--neutral-dark-grey);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.estimation-notes__input {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 20px;
  color: var(--neutral-black);
  background: var(--neutral-white);
  border: 1px solid var(--neutral-light-grey);
  border-radius: var(--radius-lg);
  resize: vertical;
  transition: border-color 0.15s ease;
}

.estimation-notes__input:focus {
  outline: none;
  border-color: var(--neutral-dark-grey);
}

.estimation-notes__input::placeholder {
  color: var(--neutral-grey);
}

/* ---- Human-in-the-loop: Accept/Dismiss actions ---- */
.estimation-card__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  margin-top: 8px;
  border-top: 1px solid var(--neutral-light-grey);
}

.estimation-card__actions .btn-primary {
  flex: 0 0 auto;
}

.estimation-card__actions .btn-tertiary {
  flex: 0 0 auto;
}

/* ---- Human-in-the-loop: Accepted confirmation ---- */
.estimation-accepted {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  text-align: center;
}

.estimation-accepted__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--green-100);
  color: var(--green-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.estimation-accepted__text {
  font-size: 16px;
  font-weight: 700;
  color: var(--neutral-black);
  margin: 0;
}

.estimation-accepted__detail {
  font-size: 13px;
  color: var(--neutral-grey);
  margin: 0;
}

.estimation-accepted__actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* ---- Human-in-the-loop: Approved badge in list ---- */
.approved-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  margin-left: 8px;
  border-radius: 32px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  background-color: var(--green-100);
  color: var(--green-700);
  white-space: nowrap;
}

/* Task breakdown table (legacy) */
.task-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 24px;
}

.task-table th {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: var(--neutral-grey);
  text-transform: uppercase;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--neutral-light-grey);
}

.task-table th:nth-child(3),
.task-table td:nth-child(3) {
  text-align: center;
}

.task-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--neutral-light-grey);
  vertical-align: middle;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 20px;
  color: var(--neutral-black);
}

.task-table tbody tr:hover {
  background-color: rgba(50, 48, 47, 0.02);
}

/* Task name cell */
.task-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-name__icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.task-name__text {
  font-weight: 500;
}

.task-name__type {
  display: block;
  font-size: 12px;
  color: var(--neutral-grey);
  font-weight: 400;
}

/* Hours cell — inline editable */
.task-hours {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 80px;
}

.task-hours__value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.task-hours__value:hover {
  border-color: var(--neutral-light-grey);
  background-color: rgba(50, 48, 47, 0.03);
}

.task-hours__value::after {
  content: '✎';
  font-size: 12px;
  color: var(--neutral-grey);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.task-hours__value:hover::after {
  opacity: 1;
}

.task-hours__input {
  width: 64px;
  padding: 4px 8px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 2px solid var(--neutral-black);
  border-radius: 8px;
  outline: none;
  color: var(--neutral-black);
  background: var(--neutral-white);
}

.task-hours__original {
  font-size: 12px;
  color: var(--neutral-grey);
  font-style: italic;
}

/* Confidence badge in table */
.confidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 32px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 16px;
  white-space: nowrap;
}

.confidence-badge--high {
  background-color: var(--green-100);
  color: var(--green-700);
}

.confidence-badge--medium {
  background-color: var(--gold-100);
  color: var(--gold-700);
}

.confidence-badge--low {
  background-color: var(--red-100);
  color: var(--red-700);
}

/* Flags cell */
.task-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Reasoning row (expandable) */
.task-reasoning-row td {
  padding: 0 12px 0 58px;
  border-bottom: 1px solid var(--neutral-light-grey);
}

.task-reasoning {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
  padding: 0;
}

.task-reasoning.is-open {
  max-height: 200px;
  padding: 8px 0 14px;
}

.task-reasoning__text {
  font-size: 13px;
  line-height: 18px;
  color: var(--neutral-dark-grey);
}

.task-reasoning__toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--neutral-grey);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.task-reasoning__toggle:hover {
  color: var(--neutral-black);
}

.task-reasoning__toggle svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

.task-reasoning__toggle.is-open svg {
  transform: rotate(180deg);
}

/* Estimation summary */
.estimation-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.estimation-summary__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.estimation-summary__value {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
}

.estimation-summary__label {
  font-size: 13px;
  color: var(--neutral-grey);
}

/* Mobile: stack task table */
@media (max-width: 640px) {
  .task-table,
  .task-table thead,
  .task-table tbody,
  .task-table tr,
  .task-table th,
  .task-table td {
    display: block;
  }

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

  .task-table td {
    padding: 8px 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .task-table td::before {
    content: attr(data-label);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--neutral-grey);
    text-transform: uppercase;
    min-width: 80px;
    flex-shrink: 0;
  }

  .task-table tbody tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--neutral-light-grey);
  }

  .task-table th:nth-child(3),
  .task-table td:nth-child(3) {
    text-align: left;
  }

  .task-reasoning-row td {
    padding-left: 0;
  }

  .ticket-header__total {
    text-align: left;
    width: 100%;
  }
}

/* ============================================
   Reallocation Page
   Option cards layout, impact simulation bars,
   decision notes, and success state.
   ============================================ */

/* Designer capacity table */
.designer-table-scroll {
  overflow-x: auto;
}

.designer-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 14px;
}

.designer-table th {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--neutral-grey);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid var(--neutral-light-grey);
  white-space: nowrap;
}

.designer-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--neutral-light-grey);
  vertical-align: middle;
  white-space: nowrap;
}

.designer-table tbody tr:hover {
  background-color: var(--neutral-white-smoke);
}

.designer-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.designer-cell__hours {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--neutral-dark-grey);
}

/* Highlighted cell when previewing a reallocation option */
.designer-cell--changed {
  background-color: var(--blue-100);
  transition: background-color 0.3s ease;
}

/* Option cards container — 3 cards in a row */
.reallocation-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* Impact simulation panel */
.reallocation-simulation {
  margin-bottom: 24px;
}

.reallocation-simulation__title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 21px;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
  margin-bottom: 16px;
}

.reallocation-simulation__empty {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--neutral-grey);
  text-align: center;
  padding: 32px 16px;
}

/* Before / After columns */
.simulation-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.simulation-column__title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--neutral-grey);
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* Individual capacity bar */
.simulation-bar {
  margin-bottom: 16px;
}

.simulation-bar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.simulation-bar__name {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--neutral-black);
}

.simulation-bar__track {
  height: 12px;
  background-color: var(--neutral-light-grey);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 4px;
}

.simulation-bar__fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}

.simulation-bar__fill--healthy {
  background-color: var(--green-500);
}

.simulation-bar__fill--at-capacity {
  background-color: var(--gold-500);
}

.simulation-bar__fill--overloaded {
  background-color: var(--red-500);
}

.simulation-bar__fill--under-utilized {
  background-color: var(--blue-500);
}

.simulation-bar__hours {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--neutral-grey);
}

/* Ticket reassignment section */
.ticket-reassignment {
  border-top: 1px solid var(--neutral-light-grey);
  margin-top: 24px;
  padding-top: 20px;
}

.ticket-reassignment__heading {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--neutral-black);
  margin-bottom: 16px;
}

.ticket-reassignment__squad {
  margin-bottom: 16px;
}

.ticket-reassignment__squad-title {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--neutral-grey);
  margin-bottom: 8px;
}

.ticket-reassignment__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ticket-reassignment__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--neutral-off-white);
  border-radius: 8px;
  flex-wrap: wrap;
}

.ticket-reassignment__reason {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--neutral-grey);
  font-style: italic;
  padding-left: 2px;
  margin-top: -4px;
}

.ticket-reassignment__ticket-title {
  flex: 1;
  font-size: 13px;
  color: var(--neutral-dark-grey);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.ticket-reassignment__hours {
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-grey);
  white-space: nowrap;
}

.ticket-reassignment__arrow {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.ticket-reassignment__arrow-icon {
  font-size: 14px;
  color: var(--neutral-grey);
}

/* Ticket reassignment action buttons */
.ticket-reassignment__actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.ticket-reassignment__action-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  transition: background-color 0.15s;
  padding: 0;
}

.ticket-reassignment__action-btn--approve {
  background-color: var(--green-100);
  color: var(--green-700);
}
.ticket-reassignment__action-btn--approve:hover {
  background-color: var(--green-200);
}

.ticket-reassignment__action-btn--edit {
  background-color: var(--gold-100);
  color: var(--gold-700);
}
.ticket-reassignment__action-btn--edit:hover {
  background-color: var(--gold-200);
}

.ticket-reassignment__action-btn--decline {
  background-color: var(--red-100);
  color: var(--red-700);
}
.ticket-reassignment__action-btn--decline:hover {
  background-color: var(--red-200);
}

/* Status badges (clickable to undo) */
.ticket-reassignment__status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 32px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
}

.ticket-reassignment__status--approved {
  background-color: var(--green-100);
  color: var(--green-700);
}

.ticket-reassignment__status--edited {
  background-color: var(--gold-100);
  color: var(--gold-700);
}

.ticket-reassignment__status--declined {
  background-color: var(--red-100);
  color: var(--red-700);
}

/* Declined row state */
.ticket-reassignment__row--declined {
  opacity: 0.5;
}
.ticket-reassignment__row--declined .ticket-reassignment__ticket-title {
  text-decoration: line-through;
}

/* Designer select dropdown for edit mode */
.ticket-reassignment__designer-select {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid var(--neutral-light-grey);
  background: var(--neutral-white);
  color: var(--neutral-dark-grey);
  cursor: pointer;
}

@media (max-width: 768px) {
  .ticket-reassignment__row {
    flex-wrap: wrap;
    gap: 6px;
  }
  .ticket-reassignment__ticket-title {
    flex-basis: 100%;
    order: 2;
  }
}

/* Decision notes */
.reallocation-notes {
  margin-bottom: 24px;
}

.reallocation-notes__label {
  display: block;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--neutral-dark-grey);
  margin-bottom: 6px;
}

.reallocation-notes__input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--neutral-platinum);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 20px;
  color: var(--neutral-black);
  resize: vertical;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.reallocation-notes__input:focus {
  outline: none;
  border-color: var(--neutral-dune);
}

.reallocation-notes__input::placeholder {
  color: var(--neutral-silver);
}

/* Success state */
.reallocation-success {
  text-align: center;
  padding: 48px 32px;
  max-width: 640px;
  margin: 0 auto;
}

.reallocation-success__icon {
  margin-bottom: 16px;
}

.reallocation-success__title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--neutral-black);
  margin-bottom: 8px;
}

.reallocation-success__summary {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--neutral-dark-grey);
  margin-bottom: 24px;
}

.reallocation-success__details {
  text-align: left;
  border-top: 1px solid var(--neutral-light-grey);
  padding-top: 16px;
  margin-bottom: 24px;
}

.reallocation-success__row {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--neutral-light-grey);
}

.reallocation-success__row-label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--neutral-grey);
  flex-shrink: 0;
  min-width: 100px;
  padding-top: 2px;
}

.reallocation-success__row-value {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 20px;
  color: var(--neutral-dark-grey);
}

/* Responsive: stack cards on mobile */
@media (max-width: 768px) {
  .reallocation-options {
    grid-template-columns: 1fr;
  }

  .simulation-comparison {
    grid-template-columns: 1fr;
  }

  .reallocation-success {
    padding: 32px 16px;
  }
}

/* ============================================
   Screen Layouts — Skills Page
   ============================================ */

.skills-page__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--grey-900);
  margin-bottom: var(--space-xs);
}

.skills-page__subtitle {
  font-size: 0.875rem;
  color: var(--grey-500);
  margin-bottom: var(--space-xl);
}

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

.skills-table th {
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--grey-200);
}

.skills-table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--grey-200);
  font-size: 0.9375rem;
  color: var(--grey-900);
}

.skills-table__name-cell {
  width: 200px;
  font-weight: 500;
}

.skills-table tr:last-child td {
  border-bottom: none;
}

.skills-tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-2xl);
  background-color: var(--grey-100);
  color: var(--grey-700);
}

.skills-tag--generalist {
  background-color: var(--purple-100);
  color: var(--purple-700);
}
