@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap");

:root {
  color-scheme: light;
  --bg-app: #f4f7f6;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f8fafc;
  --bg-surface-muted: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-hover: #f8f9fc;
  --bg-active: #ebf0fe;
  --bg-overlay: rgba(255, 255, 255, 0.92);
  --bg-tooltip: rgba(23, 43, 77, 0.95);

  --text-primary: #333333;
  --text-secondary: #475569;
  --text-muted: #8b95a5;
  --text-inverse: #ffffff;

  --border-subtle: #e2e8f0;
  --border-default: #cbd5e1;
  --border-strong: #94a3b8;
  --border-soft: rgba(148, 163, 184, 0.26);

  --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.02);
  --shadow-raised: 0 10px 25px rgba(0, 0, 0, 0.1);

  --accent-primary: #4e73df;
  --accent-primary-hover: #3b63c8;
  --accent-primary-soft: #ebf0fe;
  --accent-secondary: #36b9cc;

  --status-success-bg: #e0f2f1;
  --status-success-border: #1cc88a;
  --status-success-text: #0f5132;
  --status-warning-bg: #fff8e1;
  --status-warning-border: #f6c23e;
  --status-warning-text: #8a5a00;
  --status-danger-bg: #fde1e1;
  --status-danger-border: #e74a3b;
  --status-danger-text: #842029;
  --today-accent: #f59e0b;
  --status-info-bg: #eff6ff;
  --status-info-border: #93c5fd;
  --status-info-text: #1d4ed8;
  --status-neutral-bg: #e2e8f0;
  --status-neutral-border: #cbd5e1;
  --status-neutral-text: #475569;
  --progress-track: #e2e8f0;
  --progress-fill-soft: #7d9bf2;
  --progress-fill-strong: #4e73df;

  --table-header-bg: #ffffff;
  --table-row-hover: #f8f9fc;
  --input-bg: #ffffff;
  --input-border: #e2e8f0;
  --input-border-focus: rgba(78, 115, 223, 0.1);
  --input-text: #0f172a;
  --grid-line: #e2e8f0;

  --chart-axis: #64748b;
  --chart-grid: rgba(148, 163, 184, 0.25);
  --chart-tooltip-bg: rgba(25, 32, 43, 0.95);
  --chart-tooltip-text: #ffffff;
  --chart-blue: #4e73df;
  --chart-green: #1cc88a;
  --chart-yellow: #f6c23e;
  --chart-red: #e74a3b;

  --pink-bg: #fff0f5;
  --pink-icon: #4e73df;
  --yellow-bg: #fff8e1;
  --yellow-icon: #4e73df;
  --green-bg: #e0f2f1;
  --green-icon: #4e73df;

  --bg-main: var(--bg-app);
  --bg-sidebar: var(--bg-surface);
  --text-dark: var(--text-primary);
  --card-bg: var(--bg-surface);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-app: #0b1220;
  --bg-surface: #111827;
  --bg-surface-alt: #172131;
  --bg-surface-muted: #1e293b;
  --bg-elevated: #0f172a;
  --bg-hover: #1f2b3d;
  --bg-active: rgba(122, 162, 255, 0.16);
  --bg-overlay: rgba(15, 23, 42, 0.92);
  --bg-tooltip: rgba(2, 6, 23, 0.96);

  --text-primary: #e5edf8;
  --text-secondary: #c7d2e3;
  --text-muted: #8ea0b9;
  --text-inverse: #ffffff;

  --border-subtle: #243041;
  --border-default: #334155;
  --border-strong: #475569;
  --border-soft: rgba(148, 163, 184, 0.16);

  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.24);
  --shadow-raised: 0 14px 34px rgba(0, 0, 0, 0.38);

  --accent-primary: #7aa2ff;
  --accent-primary-hover: #93b4ff;
  --accent-primary-soft: rgba(122, 162, 255, 0.18);
  --accent-secondary: #67d4e2;

  --status-success-bg: rgba(34, 197, 94, 0.16);
  --status-success-border: rgba(18, 156, 107, 0.46);
  --status-success-text: #84d6ad;
  --status-warning-bg: rgba(245, 158, 11, 0.18);
  --status-warning-border: rgba(245, 158, 11, 0.45);
  --status-warning-text: #ffd978;
  --status-danger-bg: rgba(239, 68, 68, 0.18);
  --status-danger-border: rgba(185, 50, 50, 0.52);
  --status-danger-text: #f0a0a0;
  --today-accent: #f59e0b;
  --status-info-bg: rgba(96, 165, 250, 0.18);
  --status-info-border: rgba(96, 165, 250, 0.42);
  --status-info-text: #a5c8ff;
  --status-neutral-bg: #253244;
  --status-neutral-border: #3a4a61;
  --status-neutral-text: #c1cede;
  --progress-track: #7c8798;
  --progress-fill-soft: #5e76c7;
  --progress-fill-strong: #4963b3;

  --table-header-bg: #0f172a;
  --table-row-hover: #182235;
  --input-bg: #0f172a;
  --input-border: #334155;
  --input-border-focus: rgba(122, 162, 255, 0.22);
  --input-text: #e5edf8;
  --grid-line: #243041;

  --chart-axis: #94a3b8;
  --chart-grid: rgba(148, 163, 184, 0.18);
  --chart-tooltip-bg: rgba(2, 6, 23, 0.96);
  --chart-tooltip-text: #f8fafc;

  --pink-bg: rgba(239, 68, 68, 0.22);
  --yellow-bg: rgba(245, 158, 11, 0.22);
  --green-bg: rgba(16, 185, 129, 0.18);

  --bg-main: var(--bg-app);
  --bg-sidebar: var(--bg-surface);
  --text-dark: var(--text-primary);
  --card-bg: var(--bg-surface);
}

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

body {
  font-family: "Nunito", sans-serif;
  background-color: var(--bg-main);
  color: var(--text-dark);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
}

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

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

.app-container {
  display: flex;
  height: 100%;
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: 295px;
  height: 100%;
  background-color: var(--bg-sidebar);
  padding: 22px 0 18px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 16px 0 40px rgba(15, 23, 42, 0.08);
  z-index: 10;
  transition:
    width 0.3s ease,
    box-shadow 0.3s ease;
  overflow-x: hidden;
  border-right: 1px solid var(--border-subtle);
}
.sidebar.collapsed {
  width: 92px;
}
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 0 18px;
  margin-bottom: 18px;
}
.sidebar-brand {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.sidebar-logo-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background:
    radial-gradient(
      circle at 30% 30%,
      rgba(255, 205, 86, 0.38),
      transparent 42%
    ),
    linear-gradient(145deg, rgba(34, 211, 238, 0.22), rgba(99, 102, 241, 0.16));
  border: 1px solid
    color-mix(in srgb, var(--accent-primary) 35%, var(--border-subtle));
  color: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.sidebar-logo-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.logo-text {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-dark);
  transition: opacity 0.2s ease;
}
.logo-subtext {
  font-size: 0.77rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.sidebar-brand:hover .sidebar-logo-mark {
  border-color: color-mix(
    in srgb,
    var(--accent-primary) 55%,
    var(--border-subtle)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 10px 18px -12px color-mix(in srgb, var(--accent-primary) 45%, transparent);
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 14px;
  overflow-y: auto;
}
.sidebar-group {
  background: color-mix(in srgb, var(--bg-surface) 75%, transparent);
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 6px;
}
.sidebar-group.expanded {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-surface-alt) 88%, transparent),
    color-mix(in srgb, var(--bg-surface) 94%, transparent)
  );
  border-color: color-mix(in srgb, var(--border-subtle) 88%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.sidebar-group-toggle {
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}
.sidebar-group-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-dark);
}
.sidebar-group-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 700;
}
.sidebar-group-title i:first-child {
  width: 22px;
  text-align: center;
}
.sidebar-group-chevron {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.sidebar-group.expanded .sidebar-group-chevron {
  transform: rotate(0deg);
}
.sidebar-group:not(.expanded) .sidebar-group-chevron {
  transform: rotate(-90deg);
}
.sidebar-group-items {
  display: none;
  padding: 8px 0 2px;
  margin-top: 6px;
  border-top: 1px solid
    color-mix(in srgb, var(--border-subtle) 88%, transparent);
}
.sidebar-group.expanded .sidebar-group-items {
  display: block;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  margin: 2px 0;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  border-radius: 14px;
  border: 1px solid transparent;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
  cursor: pointer;
}
.sidebar-group-items .nav-item {
  padding-left: 42px;
  font-size: 0.95rem;
}
.nav-item i:first-child {
  width: 20px;
  font-size: 1rem;
  text-align: center;
}
.nav-item .nav-text {
  flex: 1;
  min-width: 0;
}
.nav-item.active,
.nav-item:hover {
  color: var(--text-dark);
  background-color: var(--bg-hover);
  border-color: color-mix(
    in srgb,
    var(--accent-primary) 22%,
    var(--border-subtle)
  );
}
.nav-item.active i:first-child {
  color: var(--accent-primary);
}
.nav-item.active {
  box-shadow: inset 0 0 0 1px
    color-mix(in srgb, var(--accent-primary) 18%, transparent);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 14px 0;
}
.sidebar-footer-card {
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.theme-toggle-btn {
  width: 100%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  min-height: 50px;
  padding: 6px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}
.theme-toggle-btn:hover {
  background: var(--bg-hover);
  border-color: color-mix(
    in srgb,
    var(--accent-primary) 22%,
    var(--border-subtle)
  );
}
.theme-toggle-pill {
  width: 100%;
  max-width: none;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 0;
  border-radius: 12px;
  background: transparent;
  border: none;
  box-shadow: none;
}
.theme-toggle-option {
  flex: 1;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}
.theme-toggle-option i {
  font-size: 0.9rem;
}
.theme-toggle-btn[data-theme="light"] .theme-toggle-option-light {
  background: var(--bg-surface);
  color: #f59e0b;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}
.theme-toggle-btn[data-theme="dark"] .theme-toggle-option-dark {
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  color: #fbbf24;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}
.theme-toggle-btn[data-theme="dark"] {
  background: color-mix(in srgb, var(--bg-surface-alt) 88%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.sidebar-settings-link {
  padding: 12px 14px;
}
.sidebar-settings-link i:first-child {
  font-size: 1rem;
}
.sidebar-version {
  padding: 0 14px 0 46px;
  margin-top: -2px;
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--text-muted) 88%, transparent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar.collapsed .sidebar-logo-copy,
.sidebar.collapsed .sidebar-group-label,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .sidebar-group-chevron,
.sidebar.collapsed .sidebar-version {
  display: none;
}
.sidebar.collapsed .sidebar-header {
  padding: 0 12px;
  flex-direction: column;
  align-items: center;
}
.sidebar.collapsed .sidebar-brand {
  justify-content: center;
}
.sidebar.collapsed .sidebar-nav,
.sidebar.collapsed .sidebar-footer {
  padding-left: 10px;
  padding-right: 10px;
}
.sidebar.collapsed .sidebar-group {
  padding: 6px 4px;
}
.sidebar.collapsed .sidebar-group.expanded .sidebar-group-items {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid
    color-mix(in srgb, var(--border-default) 92%, transparent);
}
.sidebar.collapsed .sidebar-group-toggle,
.sidebar.collapsed .nav-item,
.sidebar.collapsed .sidebar-settings-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
.sidebar.collapsed .sidebar-group-title {
  justify-content: center;
}
.sidebar.collapsed .sidebar-group-items .nav-item {
  padding-left: 0;
}
.sidebar.collapsed .theme-toggle-btn {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  padding: 0;
  justify-content: center;
  border-radius: 16px;
}
.sidebar.collapsed .theme-toggle-pill {
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.sidebar.collapsed .theme-toggle-option {
  display: none;
  width: 32px;
  height: 32px;
  flex: none;
}
.sidebar.collapsed
  .theme-toggle-btn[data-theme="light"]
  .theme-toggle-option-light,
.sidebar.collapsed
  .theme-toggle-btn[data-theme="dark"]
  .theme-toggle-option-dark {
  display: inline-flex;
  background: transparent;
  box-shadow: none;
}

/* Main Content & Views */
.main-content {
  flex: 1;
  height: 100%;
  --main-content-padding: 30px;
  padding: var(--main-content-padding);
  overflow-y: auto;
}
.view-section {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}
.view-section.active {
  display: block;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.view-header {
  margin-bottom: 30px;
}
.view-header h2 {
  font-size: 1.8rem;
  margin-bottom: 5px;
  color: var(--text-dark);
}
.view-header p {
  color: var(--text-muted);
}

/* --- TOP CARDS CONTAINER --- */
.top-cards {
  display: flex;
  gap: 15px; /* Adds clean spacing between the cards */
  margin-bottom: 14px;
  width: 100%;
}

/* --- INDIVIDUAL CARDS --- */
.summary-card {
  flex: 1; /* This forces all 5 cards to share the exact same width equally */
  min-width: 0; /* CRITICAL: Prevents text inside the card from forcing the card to stay wide */
  padding: 15px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Make the title text slightly smaller so it doesn't get cut off in the narrower cards */
.summary-card .subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Adjust the main metric number size to fit the new width */
.summary-card .metric {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-top: 10px;
}

/* --- RESPONSIVE FALLBACK FOR SMALL SCREENS --- */
@media (max-width: 1200px) {
  .top-cards {
    flex-wrap: wrap; /* Allows them to stack on smaller laptops */
  }
  .summary-card {
    flex: 1 1 calc(33.333% - 15px); /* Drops to 3 per row on medium screens */
  }
}
/* --- CARD COLOR OVERRIDES --- */
.summary-card.card-pink {
  background-color: var(--pink-bg) !important;
  border-color: color-mix(
    in srgb,
    var(--chart-red) 40%,
    var(--border-subtle)
  ) !important;
}
.summary-card.card-yellow {
  background-color: var(--yellow-bg) !important;
  border-color: color-mix(
    in srgb,
    var(--chart-yellow) 48%,
    var(--border-subtle)
  ) !important;
}
.summary-card.card-green {
  background-color: var(--green-bg) !important;
  border-color: color-mix(
    in srgb,
    var(--chart-green) 42%,
    var(--border-subtle)
  ) !important;
}
.summary-card .metric {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
}

/* --- METRIC CARD HEADER STYLE --- */
.card-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px; /* Creates clean spacing above the metric */
}

/* --- UPDATED CARD SUBTITLE: MATCHES ICON STYLE (Increased Size, Blue, Bold, No Margins) --- */
.summary-card .subtitle {
  font-size: 1rem; /* Increased size from 0.9rem to 1rem */
  color: var(--accent-primary);
  font-weight: 700; /* Set to bold */
  margin-top: 0; /* Removed top margin */
  text-transform: none; /* Removed uppercase text-transform */
}

/* --- UPDATED CARD ICON: CLEANER LAYOUT --- */
.summary-card .icon {
  font-size: 1.5rem;
  color: var(--accent-primary);
  margin-bottom: 0; /* Removed bottom margin */
}
.card-gradient {
  background: linear-gradient(135deg, #007bff, #00d2ff, #ffb822);
  color: white;
  display: flex;
  align-items: center;
  padding: 25px;
  border-radius: 12px;
}
.card-gradient h3 {
  font-size: 1.2rem;
  margin-bottom: 5px;
}
.card-gradient p {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Charts */
.charts-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}
.completion-layout {
  align-items: start;
  margin-bottom: 0;
}
.completion-table-card {
  min-height: 420px;
}
.completion-table-card.carryover-table-card .chart-header {
  padding: 14px 25px 8px;
  margin-bottom: 0 !important;
}
.completion-table-card thead th:first-child,
.completion-table-card tbody td:first-child {
  padding-left: 25px !important;
}
.carryover-layout {
  align-items: start;
  grid-template-columns: minmax(0, 1.52fr) minmax(500px, 1.28fr);
  margin-bottom: 0;
}
.carryover-table-card {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 0;
}
.carryover-table-card .chart-header {
  flex: 0 0 auto;
  padding: 18px 25px 10px;
  margin-bottom: 0 !important;
}
.carryover-table-card thead th:first-child,
.carryover-table-card tbody td:first-child {
  padding-left: 25px !important;
}
.pod-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.pod-sortable i {
  margin-left: 4px;
  opacity: 0.35;
  transition: opacity 0.2s ease;
  vertical-align: middle;
}
.pod-sortable.is-active {
  color: var(--chart-blue);
}
.pod-sortable:hover {
  color: var(--text-primary);
}
.stuck-table-card {
  position: relative;
  overflow: clip;
  isolation: isolate;
}
.stuck-table-card table {
  position: relative;
  z-index: 0;
}
.stuck-table-card thead {
  position: sticky;
  top: calc(-1 * var(--main-content-padding, 30px));
  z-index: 30;
}
.stuck-table-card thead::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--border-subtle);
}
.stuck-table-card thead th {
  position: static !important;
  top: auto;
  z-index: auto;
  background: var(--table-header-bg);
  box-shadow: none;
  background-clip: padding-box;
}
.carryover-table-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  min-width: 0;
  scrollbar-gutter: stable;
  padding-right: 8px;
  box-sizing: border-box;
}
.carryover-side-stack {
  min-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: start;
}
.carryover-donut-card {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  max-height: 280px;
  padding: 18px 18px 12px;
  overflow: hidden;
}
.carryover-donut-content {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 190px);
  gap: 14px;
  align-items: center;
}
.carryover-donut-wrapper {
  min-height: 180px;
  max-height: 180px;
  width: 100%;
  position: relative;
}
.compact-donut-legend {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}
.compact-donut-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1.2;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    color 120ms ease;
}
.compact-donut-legend-item.is-dimmed {
  opacity: 0.42;
}
.compact-donut-legend-item.is-selected {
  color: var(--text-primary);
  transform: translateX(2px);
}
.compact-donut-legend-swatch {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex-shrink: 0;
}
.compact-donut-legend-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.debug-split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.debug-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.debug-insight-panel {
  padding: 12px 12px 8px;
}
.debug-insight-panel-sprint {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-surface) 94%, white 6%),
    color-mix(in srgb, var(--bg-surface) 88%, var(--chart-blue) 12%)
  );
}
.debug-insight-panel-backlog {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-surface) 94%, white 6%),
    color-mix(in srgb, var(--bg-surface) 88%, var(--accent-secondary) 12%)
  );
}
.debug-insight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 24px;
  margin-bottom: 6px;
}
.debug-insight-eyebrow {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0;
}
.debug-insight-header h3,
.debug-insight-caption,
.debug-card-subtitle {
  display: none;
}
.debug-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.debug-kpi-tile {
  min-width: 0;
  padding: 6px 8px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-surface) 82%, transparent);
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--bg-surface) 82%, white 18%);
}
.debug-kpi-blue {
  border-left: 4px solid var(--chart-blue);
}
.debug-kpi-green {
  border-left: 4px solid var(--chart-green);
}
.debug-kpi-yellow {
  border-left: 4px solid var(--chart-yellow);
}
.debug-kpi-red {
  border-left: 4px solid var(--chart-red);
}
.debug-kpi-violet {
  border-left: 4px solid var(--accent-primary);
}
.debug-kpi-teal {
  border-left: 4px solid var(--accent-secondary);
}
.debug-kpi-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.debug-kpi-value {
  margin-top: 4px;
  font-size: 0.94rem;
  line-height: 1.05;
  font-weight: 800;
  color: var(--text-dark);
  overflow-wrap: anywhere;
}
.debug-kpi-value-compact {
  font-size: 0.82rem;
  line-height: 1.18;
}
.debug-table-card {
  min-height: 0;
  min-width: 0;
  max-height: calc(100dvh - 455px);
  display: flex;
  flex-direction: column;
}
.debug-table-header {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0;
}
.debug-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.debug-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  max-height: none;
  scrollbar-gutter: stable;
  padding-right: 8px;
  box-sizing: border-box;
}
.debug-priority-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  border: 0;
}
.debug-issue-cell {
  display: flex;
  align-items: center;
  min-height: 100%;
}
.debug-issue-link {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--chart-blue);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}
.debug-issue-link:hover {
  color: color-mix(in srgb, var(--chart-blue) 82%, var(--text-primary));
  text-decoration: underline;
}
.debug-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}
.debug-sortable i {
  margin-left: 4px;
  opacity: 0.35;
  transition: opacity 0.2s ease;
}
.debug-sortable.is-active {
  color: var(--chart-blue);
}
.debug-sortable:hover {
  color: var(--text-primary);
}
.debug-updated-cell {
  display: grid;
  grid-template-columns: auto 14px;
  align-items: center;
  justify-content: end;
  column-gap: 8px;
}
.debug-updated-time {
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  color: var(--text-muted);
}
.debug-updated-flags {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 14px;
  min-height: 32px;
  flex-shrink: 0;
}
.debug-updated-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 0.68rem;
  line-height: 1;
  flex-shrink: 0;
}
.debug-updated-flag-mid {
  color: #e74a3b;
  font-size: 1.15rem;
  font-weight: 700;
}
.debug-updated-flag-stale {
  color: #858796;
}
.debug-assignee-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.79rem;
  line-height: 1.3;
  color: var(--text-secondary);
}
.debug-assignee-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}
.debug-component-cell {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--text-dark);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}
.debug-status-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
}
.debug-status-cell .status-chip {
  align-self: center;
  width: auto !important;
  min-width: 68px;
  max-width: 100%;
  padding: 2px 8px;
  font-size: 0.64rem;
  line-height: 1.1;
}
.debug-status-subtext {
  display: block;
  color: var(--text-muted);
  font-size: 0.63rem;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
}
.debug-chart-card {
  min-height: 0;
  min-width: 0;
}
.debug-chart-header {
  margin-bottom: 10px;
  align-items: flex-start;
}
.debug-chart-total {
  flex-shrink: 0;
  padding: 6px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-surface-muted) 88%, transparent);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 800;
}
.debug-priority-card {
  padding: 16px 18px 14px;
}
.debug-priority-shell {
  position: relative;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.debug-priority-stack {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 54px;
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg-surface-muted) 90%, transparent);
  border: 1px solid var(--border-subtle);
}
.debug-priority-segment {
  appearance: none;
  border: 0;
  min-width: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}
.debug-priority-segment.is-tight {
  justify-content: flex-start;
  padding-left: 4px;
}
.debug-priority-segment.is-hidden-label {
  color: transparent;
}
.debug-priority-segment.is-dimmed {
  opacity: 0.34;
}
.debug-priority-segment.is-selected {
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, 0.16);
  transform: translateY(-1px);
}
.debug-priority-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
}
.debug-priority-legend-label {
  color: var(--text-muted);
}
.debug-priority-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    color 120ms ease;
}
.debug-priority-legend-item.is-empty {
  opacity: 0.48;
}
.debug-priority-legend-item.is-dimmed {
  opacity: 0.42;
}
.debug-priority-legend-item.is-selected {
  color: var(--text-primary);
  transform: translateY(-1px);
}
.debug-priority-legend-item:disabled {
  cursor: default;
}
.debug-priority-legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  flex-shrink: 0;
}
.debug-component-card {
  padding: 14px 16px 12px;
  min-height: 320px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: auto;
}
.debug-component-content {
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 210px);
  flex: 1 1 auto;
  min-height: 0;
  align-items: center;
}
.debug-component-card .carryover-donut-wrapper {
  min-height: 230px;
  height: 230px;
  max-height: 230px;
}
.debug-component-card .compact-donut-legend {
  align-self: stretch;
  min-height: 0;
}
.debug-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--bg-surface) 82%, transparent);
  border-radius: 12px;
}
.debug-segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
}
.debug-segmented-button {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}
.debug-segmented-button:hover {
  color: var(--text-primary);
}
.debug-segmented-button.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 8px 18px -18px rgba(15, 23, 42, 0.45);
}
.chart-card {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 25px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-subtle);
}
.m1-stability-shell {
  display: grid;
  gap: 16px;
}
.m1-stability-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.m1-stability-view-header-copy {
  min-width: 0;
}
.m1-stability-status {
  flex: 0 0 auto;
  width: min(320px, 100%);
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-surface-muted) 78%, white 22%);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1.35;
}
.m1-stability-status.is-loading {
  color: var(--text-primary);
}
.m1-stability-status.is-error {
  color: var(--chart-red);
}
.m1-stability-grid {
  display: grid;
  grid-template-columns: minmax(440px, 1.18fr) minmax(380px, 0.92fr);
  gap: 18px;
  align-items: stretch;
}
.m1-stability-trend-stack {
  display: grid;
  gap: 18px;
  min-height: 0;
}
.m1-stability-card {
  padding: 14px 16px 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.m1-stability-card-component {
  height: 100%;
}
.m1-stability-card-component .m1-stability-chart-frame {
  height: clamp(620px, 76vh, 920px);
}
.m1-stability-card-trend {
  min-height: 0;
}
.m1-stability-chart-header {
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.m1-stability-chart-header-main {
  min-width: 0;
}
.m1-stability-chart-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.m1-stability-chart-header-actions-component {
  justify-content: flex-start;
  margin-left: auto;
}
.m1-stability-legend-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}
.m1-stability-legend-toggle:hover {
  background: var(--bg-surface-muted);
  color: var(--text-primary);
}
.m1-stability-legend-toggle[aria-expanded="false"] {
  border-color: var(--border-default);
  background: var(--bg-surface-muted);
}
.m1-stability-legend-toggle[hidden] {
  display: none;
}
.m1-stability-total {
  flex-shrink: 0;
  align-self: flex-start;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.m1-stability-total:hover {
  border-color: var(--border-default);
  background: var(--bg-hover);
}
.m1-stability-total.is-disabled {
  pointer-events: none;
  opacity: 0.7;
}
.m1-stability-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: 24px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.m1-stability-legend-inline {
  margin-bottom: 0;
  min-height: auto;
  gap: 8px;
  justify-content: flex-start;
}
.m1-stability-legend-inline .m1-stability-legend-item {
  padding: 5px 9px;
}
.m1-stability-legend[hidden] {
  display: none;
}
.m1-stability-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    color 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}
.m1-stability-legend-item.is-dimmed {
  opacity: 0.4;
}
.m1-stability-legend-item.is-selected {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent-primary-soft) 54%, var(--bg-surface) 46%);
  border-color: color-mix(in srgb, var(--accent-primary) 24%, var(--border-subtle) 76%);
  box-shadow: 0 8px 18px -16px rgba(15, 23, 42, 0.55);
}
.m1-stability-legend-item:hover {
  transform: translateY(-1px);
}
.m1-stability-legend-item:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 58%, transparent);
  outline-offset: 2px;
}
.m1-stability-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.m1-stability-legend-item.is-line .m1-stability-legend-swatch {
  border-radius: 999px;
}
.m1-stability-legend-meta {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 800;
}
.m1-stability-chart-frame {
  position: relative;
  flex: 1 1 auto;
}
.m1-stability-chart-surface {
  position: relative;
  isolation: isolate;
  height: 100%;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.m1-stability-card-component .m1-stability-chart-surface {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.m1-stability-axis-strip {
  position: relative;
  z-index: 2;
  flex: 0 0 38px;
  margin: 0 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 86%, transparent);
  background: var(--bg-surface);
}
.m1-stability-axis-strip[hidden] {
  display: none;
}
.m1-stability-axis-tick {
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  color: var(--text-secondary);
  font-family: "Nunito", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.m1-stability-canvas-wrapper {
  position: relative;
  z-index: 2;
  height: 440px;
  padding: 8px 14px 8px;
}
.m1-stability-card-component .m1-stability-canvas-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
.m1-stability-scroll-inner {
  position: relative;
}
.m1-stability-canvas-wrapper canvas {
  position: relative;
  z-index: 2;
  display: block;
  width: 100% !important;
  height: 100% !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
}
#m1-stability-component-chart-inner {
  width: 100%;
}
#m1-stability-component-chart {
  width: 100% !important;
}
.m1-stability-card-trend .m1-stability-chart-surface {
  display: flex;
  align-items: flex-start;
}
.m1-stability-card-trend.is-legend-collapsed .m1-stability-chart-surface {
  align-items: center;
}
.m1-stability-canvas-wrapper-trend {
  height: 300px;
  width: 100%;
}
.m1-stability-empty {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-surface) 96%, transparent);
  color: var(--text-muted);
  font-size: 0.96rem;
  font-weight: 700;
}
.m1-stability-empty[hidden] {
  display: none !important;
}
.line-chart-container {
  display: flex;
  flex-direction: column;
}
.canvas-wrapper {
  position: relative;
  height: 300px;
  width: 100%;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.chart-header h3 {
  font-size: 1.1rem;
  color: var(--text-dark);
  margin: 0;
  line-height: 1.2;
}
.chart-legend,
.donut-legend {
  display: flex;
  gap: 15px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}

@media (max-width: 1180px) {
  .completion-layout,
  .carryover-layout {
    grid-template-columns: 1fr;
  }

  .completion-table-card,
  .completion-table-scroll,
  .carryover-table-card,
  .carryover-table-scroll,
  .carryover-side-stack {
    max-height: none;
    height: auto;
    min-height: 0;
  }

  .carryover-donut-content,
  .debug-split-grid {
    grid-template-columns: 1fr;
  }

  .debug-table-scroll {
    max-height: none;
    height: auto;
    min-height: 0;
  }

  .debug-table-card {
    max-height: none;
  }

  .debug-component-card {
    height: auto !important;
    min-height: 320px;
  }

  .m1-stability-grid {
    grid-template-columns: 1fr;
  }

  .m1-stability-view-header {
    flex-direction: column;
    align-items: stretch;
  }

  .m1-stability-trend-stack {
    grid-template-columns: 1fr;
  }

  .m1-stability-canvas-wrapper {
    height: 380px;
  }

  .m1-stability-chart-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .m1-stability-chart-header-component .m1-stability-chart-header-actions-component {
    margin-left: 0;
  }

  .m1-stability-chart-header-actions {
    justify-content: space-between;
    gap: 8px;
  }

  .m1-stability-card-component .m1-stability-canvas-wrapper {
    height: 460px;
  }

  .m1-stability-canvas-wrapper-trend {
    height: 320px;
  }

  .debug-component-card .carryover-donut-wrapper {
    height: 230px !important;
    min-height: 230px !important;
  }

  .debug-component-content {
    grid-template-columns: 1fr;
  }

  .compact-donut-legend {
    flex-direction: row;
    flex-wrap: wrap;
    overflow: visible;
    padding-right: 0;
  }

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

@media (max-width: 760px) {
  .debug-insight-header,
  .debug-table-header,
  .debug-chart-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .debug-segmented-control {
    width: 100%;
    justify-content: stretch;
  }

  .debug-segmented-button {
    flex: 1 1 0;
    text-align: center;
  }

  .debug-priority-legend {
    gap: 10px;
    font-size: 0.76rem;
  }

  .debug-kpi-grid {
    grid-template-columns: 1fr;
  }
}
.dot-blue {
  background-color: var(--chart-blue);
}
.dot-green {
  background-color: var(--chart-green);
}
.dot-yellow {
  background-color: var(--chart-yellow);
}
.dot-red {
  background-color: var(--chart-red);
}
.donut-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 20px;
}
.donut-inner-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  color: var(--text-dark);
  white-space: nowrap; /* NEVER break to a second line */
  transition: font-size 0.2s ease; /* Smoothly shrink/grow */
}
.donut-legend {
  flex-direction: column;
  gap: 10px;
}

/* Settings / Form Elements */
.placeholder-card,
.settings-card {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 30px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-subtle);
  max-width: 600px;
}
.mt-20 {
  margin-top: 20px;
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
}
.form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  font-family: inherit;
  outline: none;
  transition: 0.2s;
  background: var(--input-bg);
  color: var(--input-text);
}
.form-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--input-border-focus);
}
.btn-primary {
  background-color: var(--accent-primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}
.btn-primary:hover {
  background-color: var(--accent-primary-hover);
}

/* Jira Connection Status Styles */
.connection-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}
.status-box {
  display: flex;
  align-items: center;
  flex: 1;
  padding: 20px;
  background-color: var(--status-success-bg);
  border: 1px solid var(--status-success-border);
  border-radius: 8px;
  color: var(--status-success-text);
  font-weight: 700;
  font-size: 1.1rem;
}
.status-box i {
  color: var(--chart-green);
  font-size: 1.5rem;
  margin-right: 12px;
}
.btn-danger {
  background-color: var(--chart-red);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}
.btn-danger:hover {
  background-color: #c93a2e;
}
.form-instructions {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.hidden {
  display: none !important;
}
#jira-form {
  animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Custom Multi-Select Dropdown Styles */
.custom-multi-select {
  position: relative;
  width: 100%;
}
.selected-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 45px;
  padding: 6px 10px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background-color: var(--input-bg);
  cursor: text;
  transition: border-color 0.2s;
}
.selected-tags:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--input-border-focus);
}

/* Applies to Project, Team, and Sprint inputs */
.custom-multi-select input[type="text"] {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  flex: 1;
  min-width: 120px;
  font-size: 0.9rem;
  font-family: inherit;
  background: transparent;
  padding: 4px 0;
}
.project-chip {
  display: flex;
  align-items: center;
  background-color: var(--accent-primary-soft);
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 16px;
}
.project-chip .remove-chip {
  margin-left: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.project-chip .remove-chip:hover {
  color: var(--chart-red);
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 250px;
  overflow-y: auto;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  box-shadow: var(--shadow-raised);
  margin-top: 5px;
  z-index: 100;
}
.dropdown-item {
  padding: 12px 15px;
  font-size: 0.9rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: background-color 0.15s;
  border-bottom: 1px solid var(--border-subtle);
}
.dropdown-item:last-child {
  border-bottom: none;
}
.dropdown-item:hover {
  background-color: var(--bg-hover);
  color: var(--accent-primary);
}
.dropdown-item.disabled {
  color: var(--text-muted);
  cursor: default;
}
.dropdown-item.disabled:hover {
  background-color: transparent;
  color: var(--text-muted);
}

/* --- Top Card Filter Styles --- */
.filter-card {
  padding: 15px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.filter-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.mt-10 {
  margin-top: 10px;
}

/* Make the chips and inputs slightly smaller for the top card */
.custom-multi-select.small .selected-tags {
  min-height: 35px;
  padding: 3px 8px;
}

.custom-multi-select.small #team-search-input,
.custom-multi-select.small #sprint-search-input {
  font-size: 0.8rem;
  padding: 2px 0;
}

.custom-multi-select.small .project-chip {
  font-size: 0.75rem;
  padding: 2px 8px;
}
/* --- NEW POD DASHBOARD LAYOUT --- */
.pod-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.pod-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pod-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
  min-width: 0; /* Prevents chart canvases from overflowing flex containers */
}

/* Make sure the radio button container matches the dropdown inputs */
.radio-toggle-container {
  display: flex;
  gap: 20px;
  padding: 10px 15px;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
}

.radio-toggle-container label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0;
  text-transform: none;
  cursor: pointer;
}
/* --- SHARED FILTER HEADER SHELL --- */
.filter-shell-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.header-filters {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 14px 16px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg-surface) 96%, transparent),
      color-mix(in srgb, var(--bg-surface-alt) 92%, transparent)
    ),
    radial-gradient(
      circle at top left,
      rgba(16, 185, 129, 0.12),
      transparent 34%
    );
  border: 1px solid color-mix(in srgb, var(--border-default) 90%, transparent);
  border-radius: 18px;
  box-shadow: 0 14px 32px -22px rgba(15, 23, 42, 0.4);
}

.header-filters .filter-group {
  margin: 0;
}

.header-filters .filter-group label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: block;
}

.header-filter-control,
.header-filters .selected-tags {
  min-height: 40px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  background: var(--input-bg);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--text-inverse) 25%, transparent),
    0 8px 18px -16px rgba(15, 23, 42, 0.45);
}

.header-filter-control {
  display: flex;
  align-items: center;
  padding: 0 12px;
}

.header-filters #clear-filters-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--input-border) !important;
  background: var(--input-bg) !important;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--text-inverse) 25%, transparent),
    0 8px 18px -16px rgba(15, 23, 42, 0.45);
  justify-content: center;
}

.header-filters #clear-filters-btn:hover {
  background: var(--bg-hover) !important;
  border-color: color-mix(
    in srgb,
    var(--chart-red) 24%,
    var(--input-border)
  ) !important;
}

.header-filter-inline {
  justify-content: space-between;
  gap: 15px;
}

.metric-toggle-control {
  height: 45px;
  gap: 10px;
}

.filter-group-stacked {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 88px;
}

/* 1. Lock the width of the dropdown containers so they don't shift horizontally */
.header-filters .filter-group {
  width: 300px;
}

/* Let the Metric toggle stay its natural size */
.header-filters .filter-group:last-child {
  width: auto;
}

/* 2. Lock the height and manage vertical overflow */
.header-filters .selected-tags {
  height: 45px !important;
  min-height: 45px !important;
  flex-wrap: wrap !important; /* Changed to wrap! */
  overflow-x: hidden; /* Disable horizontal pushing */
  overflow-y: auto; /* Allow vertical scrolling */
  scrollbar-width: none; /* Hide scrollbar in Firefox */
  align-content: flex-start; /* Pack items neatly */
}

/* Hide the scrollbar in Chrome/Safari/Edge */
.header-filters .selected-tags::-webkit-scrollbar {
  display: none;
}

/* 3. Ensure the input field doesn't get squeezed to 0 pixels */
.header-filters .selected-tags input[type="text"] {
  flex-shrink: 0;
  min-width: 120px;
}

/* 4. Ensure the Metric toggle perfectly matches the 45px height */
.header-filters .radio-toggle-container {
  height: 45px !important;
  display: flex;
  align-items: center;
}
/* --- METRIC TOGGLE SWITCH --- */
.switch {
  position: relative;
  display: inline-block;
  width: 40px; /* Down from ~60px */
  height: 22px; /* Down from ~34px */
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-default);
  transition: 0.2s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px; /* Smaller knob */
  width: 16px; /* Smaller knob */
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
}

/* When checked (Points) -> Turn black */
input:checked + .slider {
  background-color: var(--accent-primary);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--accent-primary);
}

input:checked + .slider:before {
  transform: translateX(18px); /* Shorter travel distance for the knob */
}

/* Rounded corners */
.slider.round {
  border-radius: 22px;
}

.slider.round:before {
  border-radius: 50%;
}

.toggle-text {
  font-size: 0.85rem;
  font-weight: 700;
  transition: color 0.3s ease;
}
/* --- PERFECT VERTICAL CENTERING FOR WRAPPED CHIPS --- */

.header-filters .selected-tags {
  padding: 0 10px !important; /* Remove container padding to control lines exactly */
  row-gap: 0 !important; /* Remove flex gap so margins control the height */
  scroll-behavior: smooth; /* Makes the auto-scroll slide smoothly! */
}

/* Force each chip to sit perfectly in the middle of a 43px invisible row */
.header-filters .project-chip {
  margin-top: 10px !important;
  margin-bottom: 10px !important;
}

/* Force the text cursor to sit dead center */
.header-filters .selected-tags input[type="text"] {
  height: 43px !important;
  line-height: 43px !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* --- VISIBLE OVERFLOW & COMPACT CHIPS --- */
.header-filters .selected-tags {
  padding: 4px 10px !important; /* Creates the perfect top/bottom framing */
  row-gap: 6px !important; /* Tightens the gap between lines */
  scroll-behavior: smooth;
  align-content: flex-start !important;
}

.header-filters .selected-tags:focus-within,
.header-filter-control:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--input-border-focus);
}

/* Shrink the chips slightly so multiple rows fit partially in the 45px box */
.header-filters .project-chip {
  margin: 0 !important;
  height: 28px !important;
}

/* Match the input height to the new chip height */
.header-filters .selected-tags input[type="text"] {
  height: 28px !important;
  line-height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  min-width: 80px; /* Keeps it from getting completely crushed */
}

/* Add a hover effect for the new clear button */
#clear-filters-btn:hover {
  color: var(--chart-red) !important;
}
/* --- STATUS BANNER (Story Points Warning) --- */
.status-banner {
  margin-top: 25px;
  padding: 12px 15px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}
.status-banner-button {
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: none;
}
.status-banner-button.is-selected {
  box-shadow: inset 3px 0 0 currentColor;
  transform: translateX(2px);
}

.status-banner.banner-green {
  background-color: var(--status-success-bg);
  border: 1px solid var(--status-success-border);
  color: var(--status-success-text);
}

.status-banner.banner-green i {
  color: #1cc88a;
  font-size: 1.3rem;
}

.status-banner.banner-red {
  background-color: var(--status-danger-bg);
  border: 1px solid var(--status-danger-border);
  color: var(--status-danger-text);
}

.status-banner.banner-red i {
  color: #e74a3b;
  font-size: 1.3rem;
}
.status-banner-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.status-banner-stack .status-banner {
  margin-top: 0;
}
.completion-workload-cell {
  display: inline-grid;
  grid-template-columns: 14px auto;
  align-items: center;
  column-gap: 8px;
}
.completion-workload-value {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-start;
}
.completion-missing-points-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  min-width: 14px;
  color: var(--chart-red);
  font-size: 0.75rem;
  vertical-align: middle;
  visibility: hidden;
}
.completion-missing-points-indicator.is-visible {
  visibility: visible;
}
/* --- ASSIGNEE WORKLOAD TABLE --- */
.assignee-row {
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.2s;
}
.assignee-row.is-chart-match {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--chart-red) 10%, transparent) 0,
    color-mix(in srgb, var(--chart-red) 8%, transparent) 14%,
    transparent 42%
  );
  box-shadow: inset 5px 0 0 color-mix(in srgb, var(--chart-red) 76%, white 24%);
}
.assignee-row:hover {
  background-color: var(--table-row-hover);
}
.assignee-row.is-chart-match:hover {
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--chart-red) 10%, transparent) 0,
      color-mix(in srgb, var(--chart-red) 8%, transparent) 14%,
      transparent 42%
    ),
    var(--table-row-hover);
}
.carryover-row {
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.2s;
}
.carryover-row.is-carryover-match {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--chart-blue) 10%, transparent) 0,
    color-mix(in srgb, var(--chart-blue) 8%, transparent) 14%,
    transparent 42%
  );
  box-shadow: inset 5px 0 0 color-mix(in srgb, var(--chart-blue) 76%, white 24%);
}
.carryover-row:hover {
  background-color: var(--table-row-hover);
}
.carryover-row.is-carryover-match:hover {
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--chart-blue) 10%, transparent) 0,
      color-mix(in srgb, var(--chart-blue) 8%, transparent) 14%,
      transparent 42%
    ),
    var(--table-row-hover);
}

.interactive-row {
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.18s ease;
}

.interactive-row td {
  vertical-align: middle;
}

.interactive-row:hover {
  background-color: var(--table-row-hover);
}

.status-chip {
  display: inline-block;
  text-align: center;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.7rem;
  padding: 2px 8px;
  font-weight: 700;
  border-radius: 999px;
}

.progress-track {
  background: color-mix(in srgb, var(--progress-track) 58%, transparent);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.5s ease-out;
}

.progress-fill.primary {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--progress-fill-soft) 82%, transparent),
    color-mix(in srgb, var(--progress-fill-strong) 88%, transparent)
  );
}

.progress-fill.success {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--chart-green) 62%, transparent),
    color-mix(in srgb, var(--chart-green) 82%, transparent)
  );
}

.progress-fill.warning {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--chart-yellow) 58%, transparent),
    color-mix(in srgb, var(--chart-yellow) 78%, transparent)
  );
}
.assignee-name-container {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.9rem;
}
.assignee-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--bg-surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.assignee-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.assignee-workload {
  font-weight: 800;
  color: color-mix(in srgb, var(--text-primary) 92%, white 8%);
  font-size: 1rem;
}

/* The Inline Stacked Bar */
.stacked-bar-container {
  width: 100%;
  height: 10px;
  background-color: var(--bg-surface-muted);
  border-radius: 5px;
  display: flex;
  overflow: hidden;
}
.stacked-segment {
  height: 100%;
  transition: width 0.4s ease;
}
.segment-completed {
  background-color: var(--chart-green);
}
.segment-remaining {
  background-color: var(--chart-yellow);
}
.segment-blocked {
  background-color: var(--chart-red);
}
/* --- INTERACTIVE SUMMARY CARDS (TABS) --- */
.summary-card {
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border 0.2s ease;
  border: 2px solid transparent;
}

.summary-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-raised);
}

.summary-card.active-card {
  border: 2px solid var(--accent-primary) !important;
  box-shadow: 0 4px 15px rgba(78, 115, 223, 0.15);
}

/* --- CHART SUB-VIEWS --- */
.chart-sub-view {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.chart-sub-view.active-view {
  display: block;
}
/* --- UNIFIED ROADMAP HEADER UI --- */
.roadmap-filters-wrapper {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.roadmap-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.roadmap-actions-group {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 0;
}

.roadmap-action-button {
  min-width: 84px;
  height: 30px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
  box-shadow: 0 8px 16px -16px rgba(15, 23, 42, 0.45);
}

.roadmap-action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -18px rgba(15, 23, 42, 0.42);
}

.roadmap-action-button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: inset 0 2px 6px -4px rgba(15, 23, 42, 0.38);
}

.roadmap-action-button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--input-border-focus),
    0 14px 26px -18px rgba(15, 23, 42, 0.42);
}

.roadmap-action-button-primary {
  background: color-mix(in srgb, var(--bg-surface) 96%, white 4%);
  color: var(--text-primary);
}

.roadmap-action-button-primary:hover {
  background: color-mix(
    in srgb,
    var(--accent-primary-soft) 35%,
    var(--bg-surface) 65%
  );
  border-color: color-mix(
    in srgb,
    var(--accent-primary) 30%,
    var(--border-subtle) 70%
  );
  color: var(--accent-primary);
}

.roadmap-action-button-secondary {
  background: color-mix(
    in srgb,
    var(--bg-surface-alt) 88%,
    var(--bg-surface) 12%
  );
  color: var(--text-secondary);
}

.roadmap-action-button-secondary:hover {
  background: color-mix(
    in srgb,
    var(--status-danger-bg) 42%,
    var(--bg-surface) 58%
  );
  border-color: color-mix(
    in srgb,
    var(--status-danger-border) 32%,
    var(--border-subtle) 68%
  );
  color: var(--status-danger-text);
}

.roadmap-filter-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.roadmap-protected-filters {
  position: relative;
  display: flex;
  align-items: stretch;
  border-radius: 20px;
}

.roadmap-protected-filters-inner {
  display: inline-flex;
  align-items: flex-end;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 20px;
  position: relative;
}

.roadmap-protected-filters.is-locked .roadmap-protected-filters-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0.12)),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.08),
      rgba(148, 163, 184, 0.16)
    );
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--border-default) 82%, transparent),
    inset 0 14px 26px -22px rgba(15, 23, 42, 0.14);
  pointer-events: auto;
  z-index: 1;
}

[data-theme="dark"]
  .roadmap-protected-filters.is-locked
  .roadmap-protected-filters-inner::after {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.22), rgba(15, 23, 42, 0.32)),
    linear-gradient(135deg, rgba(15, 23, 42, 0.16), rgba(148, 163, 184, 0.08));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--border-default) 76%, transparent),
    inset 0 14px 26px -22px rgba(0, 0, 0, 0.28);
}

.roadmap-protected-filters.is-locked .roadmap-protected-filters-inner > * {
  position: relative;
  z-index: 0;
}

.roadmap-filter-lock-btn {
  position: absolute;
  top: -10px;
  right: -12px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-surface) 94%, white 6%);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 12px 24px -18px rgba(15, 23, 42, 0.35);
  transition:
    transform 0.14s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}

.roadmap-filter-lock-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px -20px rgba(15, 23, 42, 0.38);
}

.roadmap-protected-filters.is-locked .roadmap-filter-lock-btn {
  color: #a16207;
  background: color-mix(in srgb, #fef3c7 70%, var(--bg-surface) 30%);
  border-color: color-mix(in srgb, #fbbf24 34%, var(--border-subtle) 66%);
}

.roadmap-protected-filters:not(.is-locked) .roadmap-filter-lock-btn {
  color: var(--accent-primary);
}

.roadmap-actions-group,
.roadmap-filter-group-zoom {
  align-self: center;
}

/* Universal Input Box Style */
.roadmap-control-box {
  display: flex;
  align-items: center;
  min-height: 36px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  padding: 0 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-sizing: border-box;
}

.roadmap-control-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--input-border-focus);
}

.roadmap-control-box input {
  border: none;
  outline: none;
  font-size: 0.8rem;
  color: var(--input-text);
  background: transparent;
  padding: 0;
  flex: 1;
}

/* Refined Dropdown Chips */
.roadmap-control-box .project-chip {
  margin: 2px;
  padding: 2px 8px;
  font-size: 0.75rem;
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 35%, transparent);
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

/* Hides the clunky native calendar icon, but keeps the area clickable! */
.clean-date-input {
  position: relative;
}
.clean-date-input input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Segmented Control for View Range */
.roadmap-segmented-control {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
}
/* --- MODERN FLOATING DROPDOWNS --- */

/* 1. The Backdrop */
.dropdown-menu {
  border-radius: 12px !important; /* Soft, friendly corners */
  box-shadow:
    0 10px 30px -5px rgba(0, 0, 0, 0.15),
    0 8px 10px -6px rgba(0, 0, 0, 0.1) !important; /* Deep, diffused floating shadow */
  border: 1px solid var(--border-subtle) !important;
  padding: 8px 0 !important; /* Breathing room top and bottom */
  margin-top: 6px !important; /* Detach slightly from the input */
  background-color: var(--bg-elevated) !important;
}

/* 2. Soften the scrollbar inside dropdowns */
.dropdown-menu::-webkit-scrollbar {
  width: 6px;
}
.dropdown-menu::-webkit-scrollbar-track {
  background: transparent;
}
.dropdown-menu::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 10px;
}
.dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* 3. Floating Pill effect for the items */
.dropdown-item {
  margin: 2px 8px !important; /* Pulls the item away from the walls */
  padding: 8px 12px !important;
  border-radius: 6px !important; /* Rounded pill shape */
  border-bottom: none !important; /* Removes the rigid horizontal lines */
  color: var(--text-secondary) !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

/* Hover micro-interaction */
.dropdown-item:hover {
  background-color: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  transform: translateX(2px); /* Tiny slick right-shift when you hover */
}

/* Placeholder state */
.dropdown-item.disabled {
  background-color: transparent !important;
  color: var(--text-muted) !important;
  font-style: italic !important;
  transform: none !important;
  cursor: default !important;
}

/* --- ROADMAP POLISH --- */
#view-roadmap .view-header {
  padding-bottom: 18px;
}

#view-roadmap .header-titles h2 {
  margin-bottom: 6px !important;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

#view-roadmap .header-titles p {
  color: var(--text-secondary) !important;
  font-size: 0.92rem;
}

.roadmap-filters-wrapper {
  gap: 14px;
  padding: 14px 16px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg-surface) 96%, transparent),
      color-mix(in srgb, var(--bg-surface-alt) 92%, transparent)
    ),
    radial-gradient(
      circle at top left,
      rgba(16, 185, 129, 0.12),
      transparent 34%
    );
  border: 1px solid color-mix(in srgb, var(--border-default) 90%, transparent);
  border-radius: 18px;
  box-shadow: 0 14px 32px -22px rgba(15, 23, 42, 0.4);
}

.roadmap-control-box {
  min-height: 40px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--text-inverse) 25%, transparent),
    0 8px 18px -16px rgba(15, 23, 42, 0.45);
}

.roadmap-control-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--input-border-focus);
}

.roadmap-filter-divider {
  align-self: center;
  width: 1px;
  height: 48px;
  background: linear-gradient(
    180deg,
    rgba(148, 163, 184, 0),
    rgba(148, 163, 184, 0.9),
    rgba(148, 163, 184, 0)
  );
  margin: 0 2px;
}

.roadmap-shell {
  height: auto;
  min-height: 420px;
  max-height: calc(100dvh - 210px);
  padding: 0 !important;
  overflow: auto;
  position: relative;
  background: linear-gradient(
    180deg,
    var(--bg-surface) 0%,
    color-mix(in srgb, var(--bg-surface) 88%, var(--bg-surface-alt)) 100%
  );
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  box-shadow: 0 26px 45px -34px rgba(15, 23, 42, 0.45);
}

.roadmap-shell-inner {
  display: flex;
  min-width: max-content;
  min-height: max-content;
}

.roadmap-left-pane {
  position: sticky;
  left: 0;
  width: 340px;
  min-width: 340px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-surface) 98%, transparent),
    color-mix(in srgb, var(--bg-surface-alt) 98%, transparent)
  );
  z-index: 60;
  border-right: 1px solid var(--border-subtle);
  box-shadow: 16px 0 30px -28px rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  transition:
    width 0.22s ease,
    min-width 0.22s ease,
    box-shadow 0.22s ease;
}

.roadmap-left-pane.is-collapsed {
  width: 64px;
  min-width: 64px;
  box-shadow: 10px 0 24px -26px rgba(15, 23, 42, 0.28);
}

.roadmap-left-toolbar {
  min-height: 90px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: sticky;
  top: 0;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-surface) 98%, transparent),
    color-mix(in srgb, var(--bg-surface-alt) 98%, transparent)
  );
  z-index: 70;
  box-sizing: border-box;
  backdrop-filter: blur(12px);
  overflow: visible;
}

.roadmap-toolbar-buttons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.roadmap-toolbar-button {
  padding: 7px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition:
    background 0.2s,
    color 0.2s;
}

.roadmap-toolbar-button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.roadmap-toolbar-button + .roadmap-toolbar-button {
  border-left: 1px solid var(--border-default);
}

.roadmap-team-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  outline: none;
  font-size: 0.76rem;
  background: var(--input-bg);
  color: var(--input-text);
  font-weight: 700;
  box-sizing: border-box;
  box-shadow: 0 10px 20px -18px rgba(15, 23, 42, 0.55);
}

.roadmap-panel-toggle {
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s,
    transform 0.18s ease;
  flex-shrink: 0;
}

.roadmap-panel-toggle:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}

.roadmap-left-pane.is-collapsed .roadmap-left-toolbar {
  height: 104px;
  min-height: 104px;
  padding: 8px 4px 0;
  gap: 3px;
  align-items: center;
  justify-content: flex-start;
}

.roadmap-left-pane.is-collapsed .roadmap-toolbar-toprow {
  width: 100%;
  height: 100%;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-direction: column !important;
  display: flex !important;
  gap: 3px;
}

.roadmap-left-pane.is-collapsed .roadmap-toolbar-title,
.roadmap-left-pane.is-collapsed .roadmap-toolbar-input-wrap {
  display: none !important;
}

.roadmap-left-pane.is-collapsed .roadmap-toolbar-buttons {
  display: inline-flex !important;
  flex-direction: row;
  gap: 1px;
}

.roadmap-left-pane.is-collapsed .roadmap-toolbar-button {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px;
  padding: 0 !important;
  border-radius: 8px !important;
  font-size: 0.62rem !important;
  box-shadow: 0 4px 10px -10px rgba(15, 23, 42, 0.35) !important;
}

.roadmap-left-pane.is-collapsed
  .roadmap-toolbar-button
  + .roadmap-toolbar-button {
  border-left: none;
}

.roadmap-left-pane.is-collapsed .roadmap-panel-toggle {
  order: -1;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  margin-bottom: 1px;
}

.roadmap-left-pane.is-collapsed #roadmap-items-list {
  display: flex;
  flex-direction: column;
}

.roadmap-right-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-surface) 95%, transparent),
    color-mix(in srgb, var(--bg-surface-alt) 95%, transparent)
  );
}

.roadmap-timeline-header {
  height: 104px;
  min-height: 104px;
  position: sticky;
  top: 0;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-surface) 98%, transparent),
    color-mix(in srgb, var(--bg-surface-alt) 98%, transparent)
  );
  z-index: 45;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 22px -22px rgba(15, 23, 42, 0.4);
}

.roadmap-timeline-body {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-surface-alt) 38%, transparent),
    color-mix(in srgb, var(--bg-surface) 10%, transparent)
  );
}
/* --- FLATPICKR CUSTOM STYLING --- */
.flatpickr-calendar {
  border-radius: 12px !important;
  box-shadow:
    0 10px 30px -5px rgba(0, 0, 0, 0.15),
    0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid var(--border-subtle) !important;
  padding: 8px !important;
  font-family: inherit !important;
  margin-top: 6px !important;
  background: var(--bg-elevated) !important;
  color: var(--text-primary) !important;
}

/* Match the blue selection color */
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
  background: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
}
/* --- FLATPICKR CUSTOM STYLING --- */
.flatpickr-calendar {
  border-radius: 12px !important;
  box-shadow:
    0 10px 30px -5px rgba(0, 0, 0, 0.15),
    0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid var(--border-subtle) !important;
  padding: 8px !important;
  font-family: inherit !important;
  margin-top: 6px !important;
  background: var(--bg-elevated) !important;
  color: var(--text-primary) !important;

  /* NEW: Scale the calendar down so it isn't so massive */
  transform: scale(0.9) !important;
  transform-origin: top right !important; /* Anchors the scaling to the top right corner */
}

[data-theme="dark"] .flatpickr-months .flatpickr-month,
[data-theme="dark"] .flatpickr-current-month input.cur-year,
[data-theme="dark"] .flatpickr-weekday,
[data-theme="dark"] .flatpickr-day,
[data-theme="dark"] .flatpickr-time input,
[data-theme="dark"] .flatpickr-time .flatpickr-am-pm {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .flatpickr-day:hover,
[data-theme="dark"] .flatpickr-day:focus {
  background: var(--bg-hover) !important;
  border-color: var(--border-default) !important;
}

body[data-theme] .main-content,
body[data-theme] .view-header,
body[data-theme] .chart-card,
body[data-theme] .summary-card,
body[data-theme] .table-container,
body[data-theme] .pod-sidebar > *,
body[data-theme] .pod-main > *,
body[data-theme] .custom-multi-select .selected-tags,
body[data-theme] .radio-toggle-container {
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}

body[data-theme] .m1-stability-chart-surface,
body[data-theme] .m1-stability-legend-item,
body[data-theme] .m1-stability-total,
body[data-theme] .m1-stability-status {
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}

body[data-theme] table {
  color: var(--text-primary);
}

body[data-theme] thead th {
  background-color: var(--table-header-bg) !important;
  box-shadow: 0 2px 0 var(--border-subtle) !important;
}

body[data-theme] td,
body[data-theme] th {
  border-color: var(--border-subtle);
}

body[data-theme] ::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
