@font-face {
  font-family: "Gilroy";
  src: local("Gilroy Regular"), local("Gilroy-Regular"), local("Gilroy");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Gilroy";
  src: local("Gilroy Medium"), local("Gilroy-Medium"), local("Gilroy");
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
}

@font-face {
  font-family: "Gilroy";
  src: local("Gilroy Bold"), local("Gilroy-Bold"), local("Gilroy ExtraBold"), local("Gilroy-ExtraBold"), local("Gilroy");
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
}

:root {
  --ink: #0F0F0F;
  --muted: #6C6865;
  --paper: #F7F5F2;
  --surface: #FFFFFF;
  --surface-soft: #FBFAF8;
  --forest: #0F0F0F;
  --forest-2: #0F0F0F;
  --purple: #FF0072;
  --purple-soft: #FFE5F0;
  --teal: #55514F;
  --teal-soft: #EFEBE7;
  --sand: #EEEAE5;
  --sand-light: #F7F5F2;
  --yellow: #FF0072;
  --yellow-soft: #FFE5F0;
  --red: #CF3159;
  --red-soft: #FDE8EF;
  --green: #247553;
  --green-soft: #E7F2ED;
  --orange: #965C43;
  --orange-soft: #F5EBE7;
  --line: #DED9D3;
  --line-strong: #C8C1BA;
  --accent: #FF0072;
  --accent-dark: #D90061;
  --accent-soft: #FFE5F0;
  --font-sans: "Gilroy", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --shadow-sm: 0 2px 8px rgba(15, 15, 15, 0.06);
  --shadow-md: 0 16px 42px rgba(15, 15, 15, 0.14);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --sidebar-width: 260px;
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 0, 114, 0.07), transparent 26rem),
    var(--paper);
}

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

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(255, 0, 114, 0.25);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px 20px 20px;
  overflow-y: auto;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), transparent 24%),
    var(--forest-2);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 20;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.06em;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}

.brand-name {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.brand-subtitle {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.69);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.075);
  color: #fff;
}

.nav-item:active {
  transform: translateY(1px);
}

.nav-item.is-active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  font-weight: 750;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1;
}

.nav-item.is-active .nav-icon {
  background: rgba(255, 0, 114, 0.12);
}

.sidebar-spacer {
  flex: 1;
  min-height: 14px;
}

.sidebar-note {
  border-radius: 13px;
  padding: 14px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.08);
}

.sidebar-note-title {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.weight-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.weight-line strong {
  color: var(--accent);
}

.sync-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.sync-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #d8a23d;
  box-shadow: 0 0 0 4px rgba(216, 162, 61, 0.13);
}

.sync-dot.is-online {
  background: #69c38e;
  box-shadow: 0 0 0 4px rgba(105, 195, 142, 0.13);
}

.sync-dot.is-error {
  background: #ef857f;
  box-shadow: 0 0 0 4px rgba(239, 133, 127, 0.13);
}

.sync-card strong {
  display: block;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
}

.sync-card small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
}

.main-area {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 34px 20px;
  background: rgba(247, 245, 242, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(200, 193, 186, 0.72);
}

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

.eyebrow,
.modal-eyebrow,
.section-eyebrow {
  color: var(--purple);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-heading h1 {
  margin: 5px 0 3px;
  font-family: var(--font-sans);
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box {
  min-width: 250px;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(255, 0, 114, 0.10);
}

.search-box span {
  color: var(--muted);
  font-size: 19px;
  transform: rotate(-15deg);
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.button,
.icon-button,
.link-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.015em;
}

.button:hover {
  transform: translateY(-1px);
}

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

.button-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 0, 114, 0.22);
}

.button-primary:hover {
  background: var(--accent-dark);
}

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

.button-secondary:hover {
  border-color: var(--ink);
}

.button-danger {
  color: #fff;
  background: var(--red);
}

.button-danger-soft {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid rgba(163, 72, 66, 0.15);
}

.button-quiet {
  min-height: 34px;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 21px;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.link-button {
  padding: 0;
  background: none;
  color: var(--purple);
  font-size: 12px;
  font-weight: 800;
}

.link-button:hover {
  text-decoration: underline;
}

.mobile-menu {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}

.view-container {
  padding: 26px 34px 54px;
}

.stack {
  display: grid;
  gap: 22px;
}

.stack-lg {
  display: grid;
  gap: 30px;
}

.grid-2,
.grid-3,
.grid-4,
.grid-5 {
  display: grid;
  gap: 16px;
}

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

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

.kpi-card {
  min-height: 116px;
  padding: 17px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}

.kpi-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -28px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 0, 114, 0.06);
}

.kpi-card.is-accent {
  background: var(--accent-soft);
  border-color: rgba(255, 0, 114, 0.22);
}

.kpi-card.is-dark {
  background: var(--forest);
  border-color: var(--ink);
  color: #fff;
}

.kpi-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.kpi-card.is-dark .kpi-label {
  color: rgba(255,255,255,0.62);
}

.kpi-value {
  margin-top: 14px;
  font-family: var(--font-sans);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.kpi-meta {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.kpi-card.is-dark .kpi-meta {
  color: rgba(255,255,255,0.6);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.panel-title {
  margin: 3px 0 0;
  font-family: var(--font-sans);
  font-size: 20px;
  line-height: 1.2;
}

.panel-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-body {
  padding: 0 22px 22px;
}

.panel-body.flush {
  padding: 0;
}

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

.section-header h2,
.section-header h3 {
  margin: 4px 0 0;
  font-family: var(--font-sans);
}

.section-header h2 { font-size: 24px; }
.section-header h3 { font-size: 19px; }
.section-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }

.metric-list {
  display: grid;
  gap: 13px;
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(100px, 2fr) 44px;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.metric-name {
  font-weight: 700;
}

.progress-track {
  height: 8px;
  background: #ECE8E3;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--purple);
  transition: width 300ms ease;
}

.progress-fill.teal { background: var(--teal); }
.progress-fill.forest { background: var(--forest); }
.progress-fill.yellow { background: var(--yellow); }
.progress-fill.red { background: var(--red); }

.metric-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 154px 1fr;
  align-items: center;
  gap: 24px;
}

.donut {
  width: 154px;
  height: 154px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--forest) 0deg 90deg, var(--purple) 90deg 180deg, var(--teal) 180deg 270deg, var(--sand) 270deg 360deg);
  position: relative;
}

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

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-center strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 28px;
}

.donut-center span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.legend-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 9px;
  align-items: center;
  font-size: 12px;
}

.legend-swatch {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.legend-item strong {
  font-variant-numeric: tabular-nums;
}

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

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

.data-table th {
  padding: 10px 12px;
  color: #fff;
  background: var(--forest);
  text-align: left;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid #ECE8E3;
  vertical-align: top;
}

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

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

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table .center {
  text-align: center;
}

.cell-title {
  font-weight: 800;
  color: var(--ink);
}

.cell-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip,
.status-pill,
.group-pill,
.type-pill,
.priority-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.chip {
  background: #F0ECE8;
  color: #4D4947;
}

.chip.is-pool {
  background: var(--teal-soft);
  color: var(--teal);
}

.group-pill.pond-1 { color: var(--forest); background: var(--green-soft); }
.group-pill.pond-2 { color: var(--purple); background: var(--purple-soft); }
.group-pill.pool { color: var(--teal); background: var(--teal-soft); }

.type-pill.retainer { color: var(--forest); background: var(--green-soft); }
.type-pill.one-time { color: var(--purple); background: var(--purple-soft); }
.type-pill.pitch { color: var(--teal); background: var(--teal-soft); }
.type-pill.internal { color: var(--orange); background: var(--orange-soft); }

.status-pill.active,
.status-pill.in-progress { color: var(--green); background: var(--green-soft); }
.status-pill.completed { color: var(--purple); background: var(--purple-soft); }
.status-pill.on-hold,
.status-pill.paused { color: var(--orange); background: var(--orange-soft); }
.status-pill.ending-soon { color: var(--orange); background: var(--yellow-soft); }
.status-pill.ending-urgent { color: var(--red); background: var(--red-soft); }
.status-pill.not-started { color: #67615E; background: #EEEAE6; }

.priority-pill.normal,
.priority-pill.low { color: #67615E; background: #EEEAE6; }
.priority-pill.high { color: var(--orange); background: var(--orange-soft); }
.priority-pill.urgent { color: var(--red); background: var(--red-soft); }

.capacity-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.capacity-pill.is-full {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(163,72,66,0.17);
}

.project-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #ECE8E3;
}

.segmented button {
  border: 0;
  border-radius: 8px;
  padding: 7px 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.segmented button.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.select-compact {
  min-height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
}

.project-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.project-section > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 17px 19px;
  cursor: pointer;
  user-select: none;
  background: var(--surface);
}

.project-section > summary::-webkit-details-marker {
  display: none;
}

.project-section[open] > summary {
  border-bottom: 1px solid var(--line);
}

.project-summary-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-type-mark {
  width: 10px;
  height: 36px;
  border-radius: 999px;
  background: var(--forest);
}

.project-type-mark.one-time { background: var(--purple); }
.project-type-mark.pitch { background: var(--teal); }
.project-type-mark.internal { background: var(--orange); }

.project-summary-title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 18px;
}

.project-summary-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.project-summary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-section-content {
  padding: 0;
}

.project-card-list {
  display: none;
  gap: 12px;
  padding: 14px;
}

.project-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.project-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.project-card h4 {
  margin: 0;
  font-size: 15px;
}

.project-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.project-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.mini-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mini-value {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 750;
}

.project-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

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

.empty-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--forest);
  background: var(--sand);
  font-size: 24px;
}

.empty-state h3 {
  margin: 12px 0 4px;
  font-family: var(--font-sans);
  font-size: 18px;
}

.empty-state p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

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

.team-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.team-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.avatar {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--forest);
  font-weight: 850;
  font-size: 12px;
}

.avatar.pond-2 { background: var(--purple); }
.avatar.pool { background: var(--teal); }
.avatar.inactive { background: #918C88; }

.person-name {
  margin: 0;
  font-size: 14px;
  font-weight: 850;
}

.person-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.load-score {
  text-align: right;
}

.load-score strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 21px;
}

.load-score span {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.load-meter {
  height: 7px;
  margin: 15px 0 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #ECE8E3;
}

.load-meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.load-meter > span.high { background: var(--orange); }
.load-meter > span.overloaded { background: var(--red); }
.load-meter > span.available { background: #A7A19D; }

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

.team-stat {
  padding: 9px 7px;
  border-radius: 9px;
  background: var(--surface-soft);
  text-align: center;
}

.team-stat strong {
  display: block;
  font-size: 13px;
}

.team-stat span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.setup-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.setup-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 17px 18px;
  background: var(--forest);
  color: #fff;
}

.setup-group-header.pond-2 { background: var(--purple); }
.setup-group-header.pool { background: var(--teal); }

.setup-group-header h3 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 18px;
}

.setup-group-header span {
  color: rgba(255,255,255,0.65);
  font-size: 10px;
}

.member-list {
  display: grid;
}

.member-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid #ECE8E3;
}

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

.member-row.is-inactive {
  opacity: 0.55;
}

.member-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle {
  position: relative;
  display: inline-flex;
  width: 39px;
  height: 22px;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #C8C1BA;
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform var(--transition);
}

.toggle input:checked + .toggle-track {
  background: var(--green);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(17px);
}

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

.settings-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.settings-card h3 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
}

.settings-card > p {
  min-height: 34px;
  margin: 5px 0 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.setting-row {
  display: grid;
  grid-template-columns: 1fr 82px;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid #EEEAE6;
  font-size: 11px;
}

.setting-row:first-of-type {
  border-top: 0;
}

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

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

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

.field.span-2 {
  grid-column: 1 / -1;
}

.field label,
.field-label {
  color: #58524F;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea,
.setting-row input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.setting-row input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(65,62,106,0.08);
  outline: 0;
}

.field-help {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.form-error {
  margin: 0;
  color: var(--red);
  font-size: 10px;
  font-weight: 750;
}

.recommendation-box {
  padding: 13px;
  border-radius: 11px;
  background: var(--sand-light);
  border: 1px solid #E2DCD6;
}

.recommendation-box h4 {
  margin: 0 0 7px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recommendation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recommendation-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #DED7D1;
  font-size: 9px;
  font-weight: 750;
}

.modal {
  width: min(760px, calc(100vw - 26px));
  max-height: calc(100vh - 34px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--ink);
  box-shadow: var(--shadow-md);
}

.modal::backdrop {
  background: rgba(15, 15, 15, 0.64);
  backdrop-filter: blur(4px);
}

.modal-shell {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 34px);
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 22px 17px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 5px 0 0;
  font-family: var(--font-sans);
  font-size: 24px;
}

.modal-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.modal-body {
  overflow-y: auto;
  padding: 20px 22px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

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

.data-action {
  min-height: 102px;
  padding: 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  cursor: pointer;
  text-align: left;
}

.data-action:hover {
  border-color: var(--purple);
  background: #fff;
}

.data-action strong {
  display: block;
  font-size: 12px;
}

.data-action span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.notice {
  padding: 12px 13px;
  border-radius: 11px;
  background: var(--yellow-soft);
  border: 1px solid rgba(255, 0, 114, 0.24);
  color: #73103D;
  font-size: 10px;
  line-height: 1.5;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: grid;
  gap: 9px;
  pointer-events: none;
}

.toast {
  min-width: 250px;
  max-width: min(380px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 12px;
  color: #fff;
  background: var(--forest);
  box-shadow: var(--shadow-md);
  font-size: 11px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(8px);
  animation: toast-in 180ms ease forwards;
}

.toast.is-error { background: var(--red); }
.toast.is-warning { background: var(--orange); }

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

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

.deadline-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid #ECE8E3;
}

.deadline-date {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 10px;
  color: var(--purple);
  background: var(--purple-soft);
}

.deadline-date strong {
  display: block;
  font-size: 16px;
  line-height: 1;
}

.deadline-date span {
  display: block;
  margin-top: 2px;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.deadline-item h4 {
  margin: 0;
  font-size: 12px;
}

.deadline-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.pill-count {
  min-width: 24px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--sand);
  font-size: 9px;
  font-weight: 850;
}

.mobile-backdrop {
  display: none;
}

.print-only {
  display: none;
}

@media (max-width: 1240px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(290px, calc(100vw - 45px));
    transform: translateX(-105%);
    transition: transform 220ms ease;
    box-shadow: var(--shadow-md);
  }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 18;
    background: rgba(15, 15, 15, 0.48);
  }
  .mobile-backdrop.is-open { display: block; }
  .mobile-menu { display: inline-grid; place-items: center; flex: 0 0 auto; }
  .topbar { padding: 18px 22px; }
  .view-container { padding: 22px 22px 46px; }
  .topbar-actions { flex: 1; }
  .search-box { min-width: 210px; flex: 1; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .topbar {
    position: relative;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .page-heading { flex: 1; }
  .page-heading p { display: none; }
  .topbar-actions { width: 100%; justify-content: stretch; }
  .search-box { min-width: 0; flex: 1 1 100%; order: 3; }
  .topbar-actions .button { flex: 1; }
  .view-container { padding: 18px 15px 36px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-5 { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .legend-list { width: 100%; }
  .project-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-group { width: 100%; }
  .toolbar-group .select-compact { flex: 1; }
  .project-section .data-table { display: none; }
  .project-card-list { display: grid; }
  .form-grid,
  .form-grid.three { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .data-actions-grid { grid-template-columns: 1fr; }
  .modal { width: calc(100vw - 18px); max-height: calc(100vh - 18px); }
  .modal-shell { max-height: calc(100vh - 18px); }
  .project-summary-actions .button-quiet { display: none; }
  .section-header { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 470px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi-card { min-height: 102px; padding: 14px; }
  .kpi-value { font-size: 29px; }
  .project-summary-actions { gap: 4px; }
  .project-section > summary { padding: 14px; }
  .panel-header, .panel-body { padding-left: 16px; padding-right: 16px; }
  .member-row { grid-template-columns: 1fr auto; }
  .member-row > .type-pill { display: none; }
  .modal-header, .modal-body, .modal-footer { padding-left: 16px; padding-right: 16px; }
}

@media print {
  body { background: #fff; }
  .sidebar,
  .topbar-actions,
  .mobile-menu,
  .project-toolbar,
  .button,
  .icon-button,
  .member-actions,
  .toast-region { display: none !important; }
  .app-shell { display: block; }
  .topbar { position: static; padding: 0 0 18px; background: #fff; border-bottom: 2px solid #0F0F0F; }
  .view-container { padding: 18px 0; }
  .panel,
  .kpi-card,
  .team-card,
  .project-section { box-shadow: none; break-inside: avoid; }
  .print-only { display: block; }
}

/* Capacity labels and member-type tags */
.status-pill.available { color: #67615E; background: #EEEAE6; }
.status-pill.balanced { color: var(--green); background: var(--green-soft); }
.status-pill.high { color: var(--orange); background: var(--orange-soft); }
.status-pill.overloaded { color: var(--red); background: var(--red-soft); }
.type-pill.employee { color: var(--forest); background: var(--green-soft); }
.type-pill.intern { color: var(--purple); background: var(--purple-soft); }
.type-pill.freelancer { color: var(--teal); background: var(--teal-soft); }

@media (max-width: 760px) {
  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }
  .mobile-menu { grid-column: 1; grid-row: 1; }
  .page-heading { grid-column: 2; grid-row: 1; }
  .topbar-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .topbar-actions .button { width: 100%; }
  .search-box {
    grid-column: 1 / -1;
    grid-row: 2;
    order: initial;
    width: 100%;
    min-width: 0;
  }
  .topbar-actions .search-box + .button { grid-column: 1; grid-row: 1; }
  .topbar-actions .search-box + .button + .button { grid-column: 2; grid-row: 1; }
}

@media (max-width: 470px) {
  .page-heading h1 { font-size: 29px; }
  .eyebrow { font-size: 9px; }
}


/* JG brand refinements */
.brand-mark,
.brand-name,
.page-heading h1,
.panel-title,
.section-header h2,
.section-header h3,
.project-summary-title,
.kpi-value,
.donut-center strong,
.empty-state h3,
.load-score strong,
.setup-group-header h3,
.settings-card h3,
.modal-header h2 {
  font-family: var(--font-sans);
}

.brand-mark {
  letter-spacing: -0.045em;
  box-shadow: 0 9px 22px rgba(255, 0, 114, 0.24);
}

.nav-item.is-active {
  box-shadow: inset 3px 0 0 var(--accent), var(--shadow-sm);
}

.eyebrow,
.modal-eyebrow,
.section-eyebrow,
.link-button {
  color: var(--accent);
}

.button-primary:hover {
  background: var(--accent-dark);
}

.kpi-card.is-accent::after {
  background: rgba(255, 0, 114, 0.12);
}

.data-table th {
  background: var(--forest);
  border-top: 3px solid var(--accent);
}

.setup-group-header.pond-2 {
  background: var(--accent);
}

.avatar.pond-2 {
  background: var(--accent);
}

.toggle input:checked + .toggle-track {
  background: var(--accent);
}

.notice {
  background: var(--accent-soft);
}

/* ================================================================
   JG UI VERSION 1.3
   Square geometry, consistent table alignment and subtle motion
   ================================================================ */

:root {
  --radius-sm: 0px;
  --radius: 0px;
  --radius-lg: 0px;
  --ease-ui: cubic-bezier(0.22, 0.75, 0.20, 1);
  --transition: 190ms var(--ease-ui);
}

/* Deliberately square interface geometry. The donut and sync indicator
   remain circular because their shape communicates data/status. */
*,
*::before,
*::after {
  border-radius: 0 !important;
}

.donut,
.donut::after,
.sync-dot {
  border-radius: 50% !important;
}

/* Replace the former circular KPI decoration with a sharp accent rule. */
.kpi-card::after {
  right: 0;
  bottom: 0;
  width: 66px;
  height: 4px;
  background: rgba(255, 0, 114, 0.16);
}

.kpi-card.is-accent::after {
  background: rgba(255, 0, 114, 0.34);
}

/* Table alignment ------------------------------------------------- */
.data-table th,
.data-table td {
  text-align: center;
  vertical-align: middle;
}

.data-table th {
  padding: 12px 14px;
}

.data-table td {
  padding: 13px 14px;
}

.data-table .num,
.data-table .center {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.data-table .chip-row {
  justify-content: center;
}

.data-table--summary {
  table-layout: fixed;
}

.data-table--summary th,
.data-table--summary td {
  text-align: center;
}

.data-table--summary td:not(:first-child) {
  font-size: 13px;
}

/* Long descriptive cells remain left-aligned; the surrounding data
   columns are centred directly beneath their headers. */
.data-table--projects th:first-child,
.data-table--projects td:first-child,
.data-table--capacity th:first-child,
.data-table--capacity td:first-child {
  text-align: left;
}

.data-table--projects th:last-child,
.data-table--projects td:last-child,
.data-table--capacity th:not(:first-child),
.data-table--capacity td:not(:first-child) {
  text-align: center;
}

/* Motion system --------------------------------------------------- */
@keyframes jg-view-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes jg-card-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes jg-modal-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes jg-status-pulse {
  0% { box-shadow: 0 0 0 0 rgba(105, 195, 142, 0.34); }
  100% { box-shadow: 0 0 0 7px rgba(105, 195, 142, 0); }
}

.view-container > * {
  animation: jg-view-enter 340ms var(--ease-ui) both;
}

.kpi-grid > .kpi-card {
  animation: jg-card-enter 360ms var(--ease-ui) both;
}

.kpi-grid > .kpi-card:nth-child(2) { animation-delay: 35ms; }
.kpi-grid > .kpi-card:nth-child(3) { animation-delay: 70ms; }
.kpi-grid > .kpi-card:nth-child(4) { animation-delay: 105ms; }
.kpi-grid > .kpi-card:nth-child(5) { animation-delay: 140ms; }
.kpi-grid > .kpi-card:nth-child(6) { animation-delay: 175ms; }

.project-section[open] .project-section-content {
  animation: jg-reveal 230ms var(--ease-ui) both;
}

.modal[open] .modal-shell {
  animation: jg-modal-enter 230ms var(--ease-ui) both;
}

.sync-dot.is-online {
  animation: jg-status-pulse 850ms ease-out 1;
}

.progress-fill,
.load-meter > span {
  transition: width 480ms var(--ease-ui), background-color var(--transition);
}

.nav-icon,
.button,
.icon-button,
.data-action,
.kpi-card,
.panel,
.team-card,
.settings-card,
.setup-group,
.project-section,
.deadline-item,
.member-row,
.data-table tbody tr {
  transition:
    transform var(--transition),
    border-color var(--transition),
    background-color var(--transition),
    color var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
}

.button:active,
.icon-button:active,
.data-action:active {
  transform: translateY(0) scale(0.98);
}

@media (hover: hover) and (pointer: fine) {
  .button:hover,
  .icon-button:hover,
  .data-action:hover {
    transform: translateY(-2px);
  }

  .kpi-card:hover,
  .team-card:hover,
  .settings-card:hover,
  .setup-group:hover,
  .project-section:hover,
  .deadline-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 0, 114, 0.38);
    box-shadow: 0 12px 28px rgba(15, 15, 15, 0.10);
  }

  .panel:hover {
    border-color: rgba(255, 0, 114, 0.28);
    box-shadow: 0 8px 24px rgba(15, 15, 15, 0.08);
  }

  .nav-item:hover .nav-icon {
    transform: translateX(2px);
  }

  .data-table tbody tr:hover {
    background: #FFF8FB;
    box-shadow: inset 3px 0 0 var(--accent);
  }

  .member-row:hover {
    background: var(--surface-soft);
  }
}

/* Respect operating-system accessibility settings. */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}



/* Cloud account controls */
.session-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 4px;
}

.session-user {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.button-compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 11px;
}

[hidden] { display: none !important; }

@media (max-width: 1180px) {
  .session-controls { order: 4; width: 100%; justify-content: flex-end; }
}

@media (max-width: 700px) {
  .session-controls { justify-content: space-between; }
  .session-user { max-width: 58vw; }
}


/* Project mix status breakdown ------------------------------------------------ */
.metric-row {
  grid-template-columns: minmax(88px, 0.75fr) minmax(120px, 1.65fr) minmax(185px, 1fr);
  gap: 14px;
}

.metric-status-summary {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 10px;
  row-gap: 3px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.25;
  color: var(--muted);
  white-space: nowrap;
}

.metric-status-summary .metric-total {
  grid-row: 1 / span 3;
  align-self: stretch;
  min-width: 32px;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 19px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.metric-status-summary span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.metric-status-summary b {
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1180px) {
  .metric-row {
    grid-template-columns: minmax(80px, 0.8fr) minmax(105px, 1.3fr) minmax(170px, 1fr);
  }
}

@media (max-width: 900px) {
  .metric-row {
    grid-template-columns: minmax(82px, 0.75fr) minmax(120px, 1.5fr) minmax(180px, 1fr);
  }
}

@media (max-width: 620px) {
  .metric-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #ECE8E3;
  }

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

  .metric-status-summary {
    grid-template-columns: auto repeat(3, minmax(0, 1fr));
    column-gap: 8px;
    padding-left: 0;
    padding-top: 7px;
    border-left: 0;
    border-top: 1px solid var(--line);
    white-space: normal;
  }

  .metric-status-summary .metric-total {
    grid-row: auto;
    min-width: 30px;
  }

  .metric-status-summary span {
    display: grid;
    justify-items: start;
    gap: 1px;
  }
}


/* Financial year controls ---------------------------------------------------- */
.fy-switcher {
  min-width: 158px;
  display: grid;
  gap: 4px;
}

.fy-switcher > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.fy-switcher select {
  min-height: 42px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.fy-year-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.fy-year-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.fy-year-row strong {
  font-variant-numeric: tabular-nums;
}

.fy-year-row em {
  min-width: 58px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fy-carry-list {
  max-height: 310px;
  overflow-y: auto;
  border: 1px solid var(--line);
}

.fy-carry-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  align-items: start;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

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

.fy-carry-item:hover {
  background: var(--surface-soft);
}

.fy-carry-item input {
  margin-top: 3px;
}

.fy-carry-item strong,
.fy-carry-item small {
  display: block;
}

.fy-carry-item strong {
  font-size: 11px;
}

.fy-carry-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

@media (max-width: 760px) {
  .fy-switcher {
    grid-column: 1 / -1;
    width: 100%;
  }

  .fy-switcher select {
    width: 100%;
  }

  .fy-year-row {
    grid-template-columns: 1fr auto;
  }

  .fy-year-row em {
    grid-column: 1 / -1;
    justify-self: start;
  }
}


/* Hours-based capacity planning --------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

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

.capacity-person-card {
  cursor: pointer;
}

.capacity-person-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.capacity-hours-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 8px;
}

.capacity-hours-line strong {
  font-size: 18px;
  letter-spacing: -0.025em;
}

.capacity-hours-line span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.role-hour-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 14px;
}

.role-hour-grid > div {
  padding: 12px 8px;
  border-right: 1px solid var(--line);
}

.role-hour-grid > div:last-child {
  border-right: 0;
}

.role-hour-grid strong,
.role-hour-grid span {
  display: block;
}

.role-hour-grid strong {
  font-size: 13px;
}

.role-hour-grid span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.team-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.team-capacity-toolbar {
  align-items: flex-end;
}

.allocation-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 8px;
}

.allocation-percent {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.allocation-percent input {
  width: 100%;
  min-width: 0;
  border: 0 !important;
  text-align: right;
}

.allocation-percent span {
  display: grid;
  place-items: center;
  width: 27px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.setting-input-wrap {
  display: flex;
  align-items: stretch;
}

.setting-input-wrap input {
  min-width: 80px;
}

.setting-input-wrap small {
  display: grid;
  place-items: center;
  min-width: 28px;
  border: 1px solid var(--line-strong);
  border-left: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.profile-capacity-hero {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.profile-capacity-hero > div {
  padding: 15px;
  border-right: 1px solid var(--line);
}

.profile-capacity-hero > div:last-child {
  border-right: 0;
}

.profile-capacity-hero span,
.profile-capacity-hero strong {
  display: block;
}

.profile-capacity-hero span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.profile-capacity-hero strong {
  margin-top: 6px;
  font-size: 22px;
  letter-spacing: -.03em;
}

.profile-load-line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.profile-role-grid {
  margin-top: 18px;
}

.profile-section-header {
  margin-top: 24px;
  margin-bottom: 12px;
}

.profile-allocation-table {
  min-width: 680px;
}

@media (max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .kpi-grid,
  .capacity-team-grid,
  .profile-capacity-hero {
    grid-template-columns: 1fr;
  }

  .profile-capacity-hero > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .profile-capacity-hero > div:last-child {
    border-bottom: 0;
  }

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

  .role-hour-grid > div:nth-child(2) {
    border-right: 0;
  }

  .role-hour-grid > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .allocation-control {
    grid-template-columns: 1fr;
  }

  .allocation-percent {
    width: 100%;
  }
}


/* Hours-first project allocation -------------------------------------------- */
.allocation-hours {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.allocation-hours input {
  width: 100%;
  min-width: 0;
  border: 0 !important;
  text-align: right;
}

.allocation-hours span {
  display: grid;
  place-items: center;
  min-width: 48px;
  padding: 0 8px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.allocation-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.allocation-presets button {
  min-width: 36px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.allocation-presets button:hover {
  border-color: var(--ink);
  background: var(--surface-soft);
}

.allocation-field .field-help {
  margin-top: 7px;
  line-height: 1.45;
}


/* Allocation input clarity --------------------------------------------------- */
.allocation-control {
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
}

.allocation-hours {
  min-height: 52px;
  border: 1.5px solid var(--line-strong);
  background: #fff;
}

.allocation-hours:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 0, 114, 0.10);
}

.allocation-hours input {
  min-width: 68px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font-size: 18px;
  font-weight: 850;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: center;
  caret-color: var(--accent);
}

.allocation-hours input::placeholder {
  color: #B8B1AB;
  opacity: 1;
}

.allocation-hours input.is-custom-value {
  background: #FFF5FA;
}

.allocation-hours span {
  min-width: 64px;
  padding: 0 10px;
  color: #5F5A56;
  background: var(--surface-soft);
  font-size: 10px;
  letter-spacing: .04em;
}

.allocation-presets {
  gap: 6px;
  margin-top: 9px;
}

.allocation-presets button {
  min-width: 48px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: 10px;
  font-weight: 850;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.allocation-presets button:hover {
  border-color: var(--accent);
  background: #FFF5FA;
}

.allocation-presets button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.allocation-presets button.is-active:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.allocation-field .field-help {
  min-height: 16px;
  margin-top: 8px;
  color: #6C6662;
  font-size: 10px;
  font-weight: 650;
}

@media (max-width: 760px) {
  .allocation-control {
    grid-template-columns: 1fr;
  }

  .allocation-hours {
    width: 100%;
  }
}


/* UI spacing fixes: topbar + admin settings -------------------------------- */
.topbar {
  align-items: flex-start;
}

.page-heading {
  flex: 1 1 420px;
  max-width: 720px;
}

.topbar-actions {
  flex: 1 1 620px;
  min-width: 0;
  align-items: flex-end;
  justify-content: flex-end;
  column-gap: 12px;
  row-gap: 10px;
}

.fy-switcher {
  width: 280px;
  min-width: 0;
  flex: 0 1 280px;
}

.fy-switcher select {
  width: 100%;
  min-width: 0;
  padding-left: 14px;
  padding-right: 44px;
  box-sizing: border-box;
}

.session-controls {
  min-width: 0;
  max-width: 330px;
  flex: 0 1 330px;
  padding-right: 0;
}

.session-user {
  min-width: 0;
  max-width: none;
  flex: 1 1 auto;
}

.setting-row {
  grid-template-columns: minmax(0, 1fr) 124px;
  gap: 14px;
}

.setting-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  width: 100%;
  min-width: 0;
}

.setting-input-wrap input {
  width: 100%;
  min-width: 0;
}

.setting-input-wrap small {
  min-width: 0;
  width: 36px;
  box-sizing: border-box;
}

.setting-row > input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.field select,
.select-compact,
.fy-switcher select {
  padding-right: 44px;
}

@media (max-width: 1500px) {
  .page-heading {
    flex-basis: 360px;
    max-width: 560px;
  }

  .topbar-actions {
    flex-basis: 560px;
  }

  .fy-switcher {
    width: 245px;
    flex-basis: 245px;
  }

  .session-controls {
    max-width: 290px;
    flex-basis: 290px;
  }
}

@media (max-width: 1180px) {
  .topbar {
    align-items: flex-start;
  }

  .page-heading {
    max-width: none;
  }

  .topbar-actions {
    width: 100%;
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .session-controls {
    order: initial;
    width: auto;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .fy-switcher,
  .session-controls {
    width: 100%;
    max-width: none;
    flex-basis: 100%;
  }

  .setting-row {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 10px;
  }
}

/* Browser-style page history controls */
.history-nav{display:flex;gap:7px;align-items:center;align-self:flex-start;padding-top:2px;flex:0 0 auto}
.history-button{width:34px;height:34px;min-width:34px;border:1px solid var(--line-strong);background:var(--surface);font-size:17px;line-height:1}
.history-button:hover{border-color:var(--ink);background:var(--paper)}
@media(max-width:760px){.history-nav{order:-1;padding-top:0}.topbar{gap:10px}.history-button{width:32px;height:32px;min-width:32px}}


/* Cross-app desktop density / single-line guardrails */
@media (min-width: 761px) {
  .topbar {
    gap: 16px;
    padding-left: 28px;
    padding-right: 28px;
  }

  .topbar-actions {
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
  }

  .topbar-actions .button,
  .button,
  .button-quiet,
  .select-compact,
  .capacity-pill,
  .status-pill,
  .group-pill,
  .type-pill,
  .priority-pill,
  .pill-count {
    white-space: nowrap;
  }

  .search-box {
    min-width: 220px;
  }

  .view-container {
    padding-left: 28px;
    padding-right: 28px;
  }

  .panel-header {
    gap: 12px;
    padding: 17px 18px 12px;
  }

  .panel-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .section-header {
    gap: 12px;
  }

  .project-toolbar {
    gap: 8px;
    padding: 11px 13px;
  }

  .toolbar-group {
    flex-wrap: nowrap;
    gap: 7px;
    min-width: 0;
  }

  .toolbar-group > * {
    min-width: 0;
  }

  .segmented {
    flex: 0 0 auto;
  }

  .segmented button {
    white-space: nowrap;
    padding-left: 9px;
    padding-right: 9px;
  }

  .select-compact {
    min-width: 0;
    max-width: 190px;
  }

  .project-section > summary {
    gap: 10px;
    padding: 14px 16px;
  }

  .project-summary-left {
    min-width: 0;
    gap: 10px;
  }

  .project-summary-left > div:last-child {
    min-width: 0;
  }

  .project-summary-title,
  .project-summary-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .project-summary-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .member-row {
    gap: 9px;
    padding: 11px 14px;
  }

  .member-actions {
    flex-wrap: nowrap;
  }

  .modal-footer,
  .worklog-edit-actions {
    flex-wrap: nowrap;
  }
}

@media (min-width: 981px) and (max-width: 1280px) {
  .search-box {
    min-width: 180px;
  }

  .topbar {
    padding-left: 22px;
    padding-right: 22px;
  }

  .view-container {
    padding-left: 22px;
    padding-right: 22px;
  }

  .button {
    padding-left: 12px;
    padding-right: 12px;
  }

  .toolbar-group {
    gap: 6px;
  }

  .select-compact {
    max-width: 165px;
  }
}


/* Topbar readability correction */
@media (min-width: 1181px) {
  .topbar {
    display: grid;
    grid-template-columns: auto minmax(360px, 1fr) auto;
    align-items: center;
    column-gap: 16px;
  }

  .history-nav {
    align-self: center;
    padding-top: 0;
  }

  .page-heading {
    min-width: 0;
    max-width: 650px;
    flex: none;
  }

  .page-heading h1 {
    white-space: nowrap;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 166px 176px minmax(230px, 280px) auto auto;
    align-items: end;
    gap: 8px;
    min-width: 0;
    flex: none;
  }

  .fy-switcher {
    width: 166px;
    min-width: 166px;
    max-width: 166px;
    flex: none;
  }

  .fy-switcher select {
    width: 166px;
    min-width: 166px;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    padding-left: 11px;
    padding-right: 30px;
  }

  .session-controls {
    width: 176px;
    max-width: 176px;
    min-width: 0;
    flex: none;
    gap: 6px;
  }

  .session-user {
    min-width: 0;
    max-width: 104px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .session-controls .button {
    flex: 0 0 auto;
    padding-left: 10px;
    padding-right: 10px;
  }

  .topbar-actions .search-box {
    width: 100%;
    min-width: 230px;
    max-width: 280px;
  }

  .topbar-actions > .button {
    padding-left: 13px;
    padding-right: 13px;
  }
}

@media (min-width: 1181px) and (max-width: 1500px) {
  .topbar {
    grid-template-columns: auto minmax(300px, .9fr) auto;
    column-gap: 12px;
  }

  .page-heading {
    max-width: 520px;
  }

  .page-heading h1 {
    font-size: clamp(25px, 2.5vw, 34px);
  }

  .topbar-actions {
    grid-template-columns: 154px 158px minmax(190px, 230px) auto auto;
    gap: 6px;
  }

  .fy-switcher,
  .fy-switcher select {
    width: 154px;
    min-width: 154px;
    max-width: 154px;
  }

  .session-controls {
    width: 158px;
    max-width: 158px;
  }

  .session-user {
    max-width: 88px;
  }

  .topbar-actions .search-box {
    min-width: 190px;
    max-width: 230px;
  }
}


/* Dashboard topbar overlap fix */
@media (min-width: 1181px) {
  .page-heading {
    min-width: 0;
    max-width: 560px;
  }

  .page-heading h1 {
    font-size: clamp(34px, 2.35vw, 44px);
    line-height: 1.02;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-actions {
    grid-template-columns: 158px 164px minmax(220px, 280px) auto auto;
  }

  .fy-switcher,
  .fy-switcher select {
    width: 158px;
    min-width: 158px;
    max-width: 158px;
  }

  .session-controls {
    width: 164px;
    max-width: 164px;
  }
}
