:root {
  --ink: #15130f;
  --charcoal: #24201b;
  --paper: #f7f2ea;
  --paper-strong: #fffaf2;
  --sand: #c6a27d;
  --sand-deep: #9d7856;
  --sage: #7d8c76;
  --line: rgba(36, 32, 27, 0.12);
  --shadow: 0 24px 70px rgba(21, 19, 15, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(125, 140, 118, 0.12), transparent 34%),
    linear-gradient(180deg, #fffaf2 0%, #efe6da 100%);
}

.auth-pending body > main {
  visibility: hidden;
}

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

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: 32px;
  align-items: stretch;
  min-height: 260px;
  margin-bottom: 22px;
}

.brand-panel {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 20px;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.logo {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  filter: drop-shadow(0 18px 36px rgba(21, 19, 15, 0.14));
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(125, 140, 118, 0.14), transparent 38%),
    linear-gradient(180deg, #fffaf2 0%, #efe6da 100%);
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: rgba(255, 250, 242, 0.9);
  box-shadow: var(--shadow);
}

.login-logo {
  width: 150px;
  height: auto;
  margin: 0 auto 4px;
  filter: drop-shadow(0 14px 30px rgba(21, 19, 15, 0.12));
}

.login-card h1 {
  font-size: 2.35rem;
}

.remember-row {
  display: flex;
  grid-template-columns: none;
  gap: 10px;
  align-items: center;
  color: rgba(21, 19, 15, 0.72);
  font-size: 0.9rem;
}

.remember-row input {
  width: 18px;
  min-width: 18px;
  height: 18px;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: #8f3329;
  font-size: 0.9rem;
  font-weight: 800;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--sand-deep);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.15rem, 5vw, 4.85rem);
  line-height: 0.98;
}

h2 {
  font-size: 1.35rem;
}

.lede {
  max-width: 670px;
  margin: 18px 0 0;
  color: rgba(21, 19, 15, 0.68);
  font-size: 1.02rem;
  line-height: 1.65;
}

.home-grid {
  display: grid;
  grid-template-columns: 0.86fr 1fr;
  gap: 18px;
  align-items: start;
}

.home-page {
  max-width: 1040px;
}

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

.home-year-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: rgba(255, 250, 242, 0.78);
  box-shadow: 0 16px 42px rgba(21, 19, 15, 0.08);
}

.user-admin-panel {
  margin-top: 18px;
}

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

.user-form {
  display: grid;
  gap: 14px;
}

.user-form-actions {
  align-items: center;
}

.user-status {
  min-height: 20px;
  margin: 0;
  color: var(--sage);
  font-size: 0.9rem;
  font-weight: 800;
}

.user-status.is-error {
  color: #8f3329;
}

.home-year-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.home-year-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 7px;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.58);
}

.home-year-card:hover,
.team-client-card.active {
  border-color: rgba(157, 120, 86, 0.34);
  background: #fff8ed;
  box-shadow: inset 4px 0 0 var(--sand);
}

.home-year-card span,
.home-year-card small {
  color: rgba(21, 19, 15, 0.56);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.home-year-card strong {
  display: block;
  font-size: 1.35rem;
}

.year-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.year-edit-form {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  width: 100%;
}

.year-error {
  min-height: 18px;
  margin: 0;
  color: #8f3329;
  font-size: 0.82rem;
  font-weight: 800;
}

.workspace-panel,
.action-panel,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.78);
  box-shadow: 0 16px 42px rgba(21, 19, 15, 0.08);
}

.workspace-panel,
.action-panel {
  padding: 22px;
}

.detail-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 464px;
  padding: 24px;
}

.project-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.workspace-header {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 22px;
}

.workspace-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.project-helper-panel,
.project-detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.78);
  box-shadow: 0 16px 42px rgba(21, 19, 15, 0.08);
}

.project-helper-panel {
  padding: 22px;
}

.project-detail-panel {
  grid-column: auto;
  grid-row: auto;
  width: 100%;
}

.section-heading,
.input-row,
.metric-row {
  display: flex;
  align-items: center;
}

.section-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: var(--paper-strong);
  background: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
}

label {
  display: grid;
  gap: 8px;
  color: rgba(21, 19, 15, 0.68);
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  outline: none;
}

input,
select {
  height: 46px;
  padding: 0 14px;
}

textarea {
  min-height: 92px;
  resize: vertical;
  padding: 13px 14px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sand-deep);
  box-shadow: 0 0 0 3px rgba(198, 162, 125, 0.24);
}

.input-row {
  gap: 10px;
}

.input-row.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}

.primary-button {
  height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: var(--paper-strong);
  background: var(--charcoal);
  font-weight: 800;
  white-space: nowrap;
}

.secondary-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 800;
  white-space: nowrap;
}

.primary-button.wide {
  width: 100%;
  margin-top: 16px;
}

.year-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.year-chip,
.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: rgba(21, 19, 15, 0.72);
  font-size: 0.82rem;
  font-weight: 800;
}

.year-chip {
  min-height: 36px;
  padding: 0 13px;
}

.year-chip.active {
  color: var(--paper-strong);
  background: var(--sage);
  border-color: transparent;
}

.status-pill {
  padding: 8px 12px;
}

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

.home-action {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.58);
}

.home-action.active {
  border-color: rgba(157, 120, 86, 0.34);
  background: #fff8ed;
  box-shadow: inset 4px 0 0 var(--sand);
}

.action-index {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--paper-strong);
  background: var(--sand-deep);
  font-size: 0.78rem;
  font-weight: 900;
}

.home-action strong,
.home-action small {
  display: block;
}

.home-action strong {
  margin-bottom: 5px;
  font-size: 1rem;
}

.home-action small {
  color: rgba(21, 19, 15, 0.58);
  font-size: 0.83rem;
  line-height: 1.45;
}

.project-form {
  display: grid;
  gap: 20px;
}

.form-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  align-items: flex-start;
  margin: -24px -24px 22px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.96);
  backdrop-filter: blur(12px);
}

.panel-note {
  margin: 8px 0 0;
  color: rgba(21, 19, 15, 0.58);
  font-size: 0.9rem;
  line-height: 1.45;
}

.top-actions {
  min-width: 260px;
  justify-content: flex-end;
}

.top-actions .primary-button,
.top-actions .secondary-button {
  min-width: 124px;
}

.form-strip,
.finance-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.finance-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 14px;
  border: 1px solid rgba(157, 120, 86, 0.22);
  border-radius: 8px;
  background: #fff8ed;
}

.finance-summary input {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  font-weight: 900;
}

.event-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 2px;
}

.event-toolbar h3 {
  margin: 0;
  font-size: 1rem;
}

.event-list {
  display: grid;
  gap: 14px;
}

.event-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.66);
}

.event-card-header {
  display: grid;
  grid-template-columns: minmax(170px, 0.42fr) 1fr auto;
  gap: 12px;
  align-items: end;
}

.event-summary {
  display: grid;
  gap: 4px;
  min-height: 70px;
  border: 1px solid rgba(36, 32, 27, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--paper-strong);
  text-align: left;
  background: var(--charcoal);
}

.event-summary span,
.event-summary small {
  color: rgba(255, 250, 242, 0.64);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.event-summary strong {
  font-size: 1rem;
}

.event-card.is-collapsed {
  gap: 0;
}

.event-card.is-collapsed .event-title-fields,
.event-card.is-collapsed .role-grid,
.event-card.is-collapsed .payment-panel {
  display: none;
}

.event-title-fields {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 12px;
}

.role-grid {
  display: grid;
  gap: 10px;
}

.role-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid rgba(36, 32, 27, 0.08);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.76);
}

.role-toggle {
  display: flex;
  grid-template-columns: none;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 900;
}

.role-toggle input {
  width: 18px;
  min-width: 18px;
  height: 18px;
}

.role-details {
  display: none;
  grid-template-columns: minmax(110px, 0.45fr) minmax(220px, 1.35fr) minmax(130px, 0.55fr);
  gap: 12px;
  align-items: end;
}

.role-row.is-open .role-details {
  display: grid;
}

.name-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.payment-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(21, 19, 15, 0.05);
}

.event-total input {
  color: var(--paper-strong);
  background: var(--ink);
  font-weight: 900;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#cancelEditButton {
  display: none;
}

#cancelEditButton.is-visible {
  display: inline-flex;
  align-items: center;
}

.team-view {
  display: grid;
  gap: 18px;
}

.is-hidden {
  display: none;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.metric-row > div {
  min-height: 82px;
  border-radius: 8px;
  padding: 14px;
  background: var(--ink);
  color: var(--paper-strong);
}

.year-metric-row {
  margin-bottom: 16px;
}

.metric-row span,
.metric-row strong {
  display: block;
}

.metric-row span {
  margin-bottom: 8px;
  color: rgba(255, 250, 242, 0.64);
  font-size: 0.78rem;
  font-weight: 700;
}

.metric-row strong {
  font-size: clamp(1rem, 2.2vw, 1.45rem);
}

.project-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-row {
  display: grid;
  grid-template-columns: 1fr 0.7fr auto;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
  align-items: center;
}

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

.project-row span {
  display: block;
  color: rgba(21, 19, 15, 0.56);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.project-row strong {
  display: block;
  margin-top: 4px;
  font-size: 0.94rem;
}

.client-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.small-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 900;
}

.small-button.primary {
  color: var(--paper-strong);
  background: var(--charcoal);
  border-color: transparent;
}

.small-button.danger {
  color: #fffaf2;
  background: #8f3329;
  border-color: transparent;
}

.client-detail {
  display: grid;
  gap: 14px;
}

.client-empty {
  padding: 18px;
  border: 1px dashed rgba(36, 32, 27, 0.2);
  border-radius: 8px;
  color: rgba(21, 19, 15, 0.58);
  background: rgba(255, 255, 255, 0.42);
  font-weight: 700;
}

.client-summary {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.client-page-grid {
  display: grid;
  gap: 18px;
}

.client-page-summary {
  background: rgba(255, 250, 242, 0.78);
}

.client-summary-header,
.detail-event-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.client-summary h3 {
  margin: 0;
  font-size: 1.18rem;
}

.client-summary-header small {
  display: block;
  margin-top: 6px;
  color: rgba(21, 19, 15, 0.58);
  font-size: 0.82rem;
  font-weight: 800;
}

.detail-event {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(36, 32, 27, 0.1);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.84);
}

.detail-event-header {
  display: grid;
  grid-template-columns: 168px 1fr;
  align-items: stretch;
  gap: 12px;
}

.date-badge,
.event-name-block {
  display: grid;
  gap: 5px;
  border-radius: 8px;
  padding: 12px;
}

.date-badge {
  color: var(--paper-strong);
  background: var(--charcoal);
}

.event-name-block {
  border: 1px solid rgba(36, 32, 27, 0.1);
  background: rgba(255, 255, 255, 0.66);
}

.date-badge span,
.event-name-block span,
.team-role-label small {
  color: rgba(21, 19, 15, 0.56);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.date-badge span {
  color: rgba(255, 250, 242, 0.64);
}

.date-badge strong,
.event-name-block strong {
  font-size: 1rem;
}

.team-role-table {
  display: grid;
  gap: 8px;
}

.team-role-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  border: 1px solid rgba(36, 32, 27, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
}

.team-role-label {
  display: grid;
  gap: 3px;
}

.team-role-label span {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

.team-role-row strong {
  color: rgba(21, 19, 15, 0.82);
  font-size: 0.95rem;
  line-height: 1.45;
}

.detail-role {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.detail-role span {
  display: block;
  margin-bottom: 4px;
  color: rgba(21, 19, 15, 0.56);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-role strong {
  font-size: 0.9rem;
}

.team-page {
  width: min(1500px, calc(100% - 32px));
  padding-top: 22px;
}

.team-header {
  display: grid;
  grid-template-columns: 116px minmax(260px, 1fr);
  gap: 18px 26px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.72);
  box-shadow: 0 16px 42px rgba(21, 19, 15, 0.08);
}

.brand-link {
  display: grid;
  place-items: center;
  min-height: 92px;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.team-logo {
  width: 104px;
  height: auto;
  filter: drop-shadow(0 12px 26px rgba(21, 19, 15, 0.12));
}

.team-title h1 {
  max-width: none;
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1;
}

.team-title .lede {
  max-width: 760px;
  margin-top: 10px;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.team-header .workspace-actions {
  grid-column: 2;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.team-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.client-list-panel,
.team-detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.78);
  box-shadow: 0 16px 42px rgba(21, 19, 15, 0.08);
}

.client-list-panel {
  padding: 22px;
}

.team-detail-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.team-client-list {
  display: grid;
  gap: 8px;
}

.team-client-button {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 0;
  padding: 0;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.team-client-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) 90px minmax(110px, 0.72fr) minmax(110px, 0.72fr) minmax(110px, 0.72fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.team-card-actions {
  justify-content: flex-end;
}

.team-client-button span,
.team-client-button small {
  color: rgba(21, 19, 15, 0.56);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.team-client-button strong {
  font-size: 1rem;
}

.team-client-stat {
  display: grid;
  gap: 4px;
}

.team-client-stat span {
  color: rgba(21, 19, 15, 0.56);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.team-client-stat strong {
  font-size: 0.95rem;
}

.pricing-panel {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(157, 120, 86, 0.22);
  border-radius: 8px;
  padding: 16px;
  background: #fff8ed;
}

.matrix-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(36, 32, 27, 0.1);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.matrix-title h3 {
  margin: 0;
  font-size: 1.02rem;
}

.matrix-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.team-matrix {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.team-matrix th,
.team-matrix td {
  border-right: 1px solid rgba(36, 32, 27, 0.08);
  border-bottom: 1px solid rgba(36, 32, 27, 0.08);
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

.team-matrix tr:last-child th,
.team-matrix tr:last-child td {
  border-bottom: 0;
}

.team-matrix th:last-child,
.team-matrix td:last-child {
  border-right: 0;
}

.team-matrix thead th {
  background: var(--charcoal);
  color: var(--paper-strong);
}

.team-matrix thead th:first-child {
  width: 170px;
}

.team-matrix thead span,
.team-matrix thead small {
  display: block;
  color: rgba(255, 250, 242, 0.64);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.team-matrix thead strong {
  display: block;
  margin: 5px 0 3px;
  font-size: 1rem;
}

.team-matrix tbody th {
  color: var(--ink);
  background: #fff8ed;
  font-size: 0.9rem;
  font-weight: 900;
}

.team-matrix tbody td {
  color: rgba(21, 19, 15, 0.84);
  font-size: 0.94rem;
  font-weight: 750;
  line-height: 1.45;
}

.expense-matrix tbody td {
  font-weight: 850;
}

.matrix-total-row th,
.matrix-total-row td {
  color: var(--paper-strong) !important;
  background: var(--charcoal) !important;
}

.muted-cell {
  color: rgba(21, 19, 15, 0.36);
}

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

.pricing-summary > div {
  display: grid;
  gap: 6px;
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.pricing-summary span,
.chart-row > span {
  color: rgba(21, 19, 15, 0.56);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pricing-summary strong {
  font-size: 1.12rem;
}

.profit-chart {
  display: grid;
  gap: 10px;
}

.chart-row {
  display: grid;
  grid-template-columns: 180px 1fr 120px;
  gap: 12px;
  align-items: center;
}

.chart-track {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(36, 32, 27, 0.1);
}

.chart-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--sage);
}

.chart-row.quote .chart-bar {
  background: var(--sand-deep);
}

.chart-row.expense .chart-bar,
.chart-row.loss .chart-bar {
  background: #8f3329;
}

.chart-row.profit .chart-bar {
  background: var(--sage);
}

.chart-row > strong {
  text-align: right;
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 22px, 680px);
    padding-top: 12px;
  }

  .hero,
  .home-grid,
  .detail-panel,
  .workspace-header,
  .project-workspace-grid,
  .team-header,
  .team-layout,
  .team-client-card,
  .input-row.split,
  .form-strip,
  .finance-summary,
  .pricing-summary,
  .chart-row,
  .metric-row,
  .event-card-header,
  .event-title-fields,
  .role-row,
  .payment-panel,
  .detail-roles,
  .detail-event-header,
  .team-role-row {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 18px;
  }

  .brand-panel {
    min-height: 190px;
    padding: 26px;
  }

  .logo {
    max-width: 220px;
  }

  .hero-copy {
    padding: 4px 0 10px;
  }

  .detail-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .project-row {
    grid-template-columns: 1fr;
  }

  .client-actions,
  .form-actions,
  .form-topbar,
  .event-toolbar,
  .workspace-actions,
  .home-admin-actions,
  .year-card-actions,
  .client-summary-header {
    align-items: stretch;
    flex-direction: column;
  }

  .form-topbar {
    position: static;
    margin: -24px -24px 18px;
  }

  .top-actions {
    min-width: 0;
  }

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

  .role-toggle {
    padding-bottom: 0;
  }

  .team-header {
    gap: 14px;
  }

  .team-header .workspace-actions {
    grid-column: 1;
  }

  .brand-link {
    min-height: 112px;
  }

  .nav-button {
    width: 100%;
  }

  .team-card-actions {
    justify-content: stretch;
  }

  .team-card-actions .small-button {
    flex: 1;
  }

  .chart-row > strong {
    text-align: left;
  }

  .team-matrix {
    min-width: 680px;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .brand-link,
  .workspace-actions,
  .client-actions,
  .year-form,
  .icon-button {
    display: none !important;
  }

  .shell {
    width: 100%;
    padding: 0;
  }

  .team-header,
  .client-list-panel,
  .team-detail-panel,
  .client-summary,
  .pricing-panel,
  .matrix-card {
    box-shadow: none !important;
    break-inside: avoid;
  }

  .team-client-card {
    break-inside: avoid;
  }

  .matrix-scroll {
    overflow: visible;
  }
}
