:root {
  --color-page: #08111b;
  --color-surface: #101a27;
  --color-surface-elevated: #152132;
  --color-surface-soft: #1b2a3e;
  --color-text: #f4f7fb;
  --color-muted: #a9b6c6;
  --color-border: #2a394d;
  --color-primary: #f47c20;
  --color-primary-strong: #ffad42;
  --color-primary-soft: rgba(244, 124, 32, 0.16);
  --color-secondary: #111c2b;
  --color-accent: #c5cfdd;
  --color-success: #3bb878;
  --color-warning: #f5b947;
  --color-danger: #ff6666;
  --planning-team-panel: rgba(55, 139, 182, 0.14);
  --planning-team-panel-border: rgba(97, 180, 220, 0.42);
  --planning-provider-panel: rgba(244, 124, 32, 0.11);
  --planning-provider-panel-border: rgba(244, 156, 79, 0.42);
  --shadow-soft: 0 18px 42px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  --sidebar-width: 280px;
}

/* Administration / Management operational control center. */
.administration-control-center,
.administration-control-center * {
  min-width: 0;
}

.administration-control-center {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  overflow-wrap: anywhere;
}

.administration-existing-controls {
  margin-top: 0.75rem;
}

.administration-control-loading {
  display: grid;
  gap: 0.25rem;
  min-height: 7rem;
  place-content: center;
  text-align: center;
}

.administration-control-loading span,
.administration-control-updated {
  color: var(--color-muted);
  font-size: 0.82rem;
}

.administration-control-notice {
  margin: 0;
}

.panel.administration-dashboard-section {
  padding: 0;
  overflow: visible;
  scroll-margin-top: calc(var(--legacy-topbar-height, 72px) + 1rem);
}

.administration-dashboard-section > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem;
  cursor: pointer;
  list-style: none;
}

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

.administration-dashboard-section > summary::after {
  content: '+';
  color: var(--color-primary);
  font-size: 1.15rem;
  font-weight: 900;
}

.administration-dashboard-section[open] > summary {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
}

.administration-dashboard-section[open] > summary::after {
  content: '−';
}

.administration-dashboard-section-summary-copy {
  display: grid;
  gap: 0.16rem;
}

.administration-dashboard-section-summary-copy strong,
.administration-dashboard-section-summary-copy small {
  display: block;
}

.administration-dashboard-section-summary-copy strong {
  font-size: 0.98rem;
}

.administration-dashboard-section-summary-copy small {
  color: var(--color-muted);
  font-size: 0.77rem;
}

.administration-dashboard-section-body {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
}

.administration-dashboard-section-body-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.administration-dashboard-section-body-heading h2 {
  margin: 0;
}

.administration-dashboard-section-body-heading p {
  margin: 0.25rem 0 0;
  color: var(--color-muted);
}

.administration-control-toolbar,
.administration-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.administration-control-toolbar h2,
.administration-section-heading h2 {
  margin: 0.1rem 0 0;
}

.administration-control-toolbar p,
.administration-section-heading p {
  margin: 0.25rem 0 0;
  color: var(--color-muted);
}

.administration-control-toolbar .eyebrow,
.administration-section-heading .eyebrow {
  margin: 0;
  color: var(--color-primary-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.administration-week-form {
  display: flex;
  flex: 0 0 auto;
  align-items: end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.administration-week-form .field {
  /* Native week inputs need room for “Semana 36 de 2026” and their
     calendar affordance. The flex basis lets the action wrap, rather than
     clipping the year or widening the dashboard on narrow screens. */
  width: 13.5rem;
  min-inline-size: min(100%, 13.5rem);
  margin: 0;
}

.administration-week-form input[type="week"] {
  inline-size: 100%;
  min-height: 40px;
  padding-block: 0.45rem;
  color-scheme: dark;
}

/* The native calendar button follows the control scheme, rather than a
   fixed icon colour. This keeps it visible in light, dark and contrast modes. */
body.theme-light .administration-week-form input[type="week"] {
  color-scheme: light;
}

body.theme-contrast .administration-week-form input[type="week"] {
  color-scheme: dark;
}

.administration-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.65rem;
}

.administration-summary-card {
  display: grid;
  gap: 0.18rem;
  min-height: 5.7rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: var(--radius);
  color: var(--color-text);
  background: var(--color-surface);
}

.administration-summary-card:hover,
.administration-summary-card:focus-visible {
  color: var(--color-text);
  background: var(--color-surface-elevated);
}

.administration-summary-card.is-critical { border-top-color: var(--color-danger); }
.administration-summary-card.is-attention { border-top-color: var(--color-warning); }
.administration-summary-card.is-information { border-top-color: var(--color-primary); }
.administration-summary-card span { color: var(--color-muted); font-size: 0.75rem; font-weight: 700; }
.administration-summary-card strong { align-self: end; font-size: clamp(1.05rem, 1.9vw, 1.45rem); font-variant-numeric: tabular-nums; }

.administration-section {
  display: grid;
  gap: 0.75rem;
  scroll-margin-top: calc(var(--legacy-topbar-height, 72px) + 1rem);
}

.administration-count-badge,
.administration-management-card > summary > b {
  display: inline-grid;
  min-width: 2rem;
  min-height: 2rem;
  place-items: center;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text);
  background: var(--color-surface-soft);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.administration-alert-list,
.administration-compact-list {
  display: grid;
  gap: 0.5rem;
}

.administration-alert-list {
  max-height: 48rem;
  overflow: auto;
  padding-right: 0.15rem;
}

.administration-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.administration-alert.is-critical { border-left-color: var(--color-danger); }
.administration-alert.is-attention { border-left-color: var(--color-warning); }
.administration-alert.is-information { border-left-color: var(--color-primary); }

.administration-alert-level {
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  color: var(--color-text);
  background: var(--color-surface-soft);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.administration-alert-copy,
.administration-management-card > summary span,
.administration-compact-list article > div {
  display: grid;
  gap: 0.08rem;
}

.administration-alert-copy span,
.administration-alert-copy small,
.administration-management-card > summary small,
.administration-compact-list article span,
.administration-compact-list article small {
  color: var(--color-muted);
}

.administration-alert-copy span,
.administration-compact-list article span { font-size: 0.82rem; }
.administration-alert-copy small,
.administration-compact-list article small { font-size: 0.72rem; }
.administration-alert-project { color: var(--color-text) !important; font-weight: 700; }

.administration-alert-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.administration-alert-actions form { margin: 0; }
.administration-alert-actions .button { min-height: 34px; padding: 0.35rem 0.55rem; font-size: 0.72rem; white-space: nowrap; }
.administration-snooze { position: relative; }
.administration-snooze > summary { padding: 0.38rem 0.55rem; border: 1px solid var(--color-border); border-radius: var(--radius); color: var(--color-primary-strong); font-size: 0.72rem; font-weight: 700; cursor: pointer; list-style: none; }
.administration-snooze > summary::-webkit-details-marker { display: none; }
.administration-snooze[open] form { position: absolute; z-index: 10; top: calc(100% + 0.35rem); right: 0; display: flex; width: max-content; max-width: min(23rem, 82vw); gap: 0.4rem; padding: 0.55rem; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface-elevated); box-shadow: var(--shadow-soft); }
.administration-snooze input { width: 10rem; min-height: 34px; padding: 0.35rem; font-size: 0.75rem; }

.administration-expandable,
.panel.administration-management-card {
  padding: 0;
  overflow: visible;
}

.administration-expandable > summary,
.administration-management-card > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem;
  cursor: pointer;
  list-style: none;
}

.administration-expandable > summary::-webkit-details-marker,
.administration-management-card > summary::-webkit-details-marker { display: none; }
.administration-expandable > summary::after { content: '+'; color: var(--color-primary-strong); font-weight: 900; }
.administration-expandable[open] > summary::after { content: '−'; }
.administration-expandable > summary span { color: var(--color-muted); }
.administration-expandable > .administration-compact-list { padding: 0 0.85rem 0.85rem; }

.administration-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.administration-management-card {
  scroll-margin-top: calc(var(--legacy-topbar-height, 72px) + 1rem);
}

.administration-management-card[open] > summary {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
}

.administration-management-card > summary strong { font-size: 0.94rem; }
.administration-management-card > summary small { margin-top: 0.1rem; font-size: 0.74rem; font-weight: 400; }
.administration-card-body { max-height: 31rem; overflow: auto; padding: 0.75rem; }

.administration-compact-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.62rem;
  border: 1px solid var(--color-border);
  border-radius: 0.45rem;
  background: var(--color-surface-elevated);
}

.administration-compact-list article.is-critical { border-left: 3px solid var(--color-danger); }
.administration-compact-list article > a { flex: 0 0 auto; font-size: 0.74rem; }
.administration-card-more { display: block; margin-top: 0.3rem; padding: 0.45rem; text-align: right; font-size: 0.78rem; font-weight: 700; }
.administration-wide-card { margin: 0; }

.administration-change-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0.75rem;
}

.administration-change-columns h3 { margin: 0 0 0.45rem; font-size: 0.82rem; }
.administration-change-columns .administration-compact-list { max-height: 25rem; overflow: auto; }

.administration-team-grid,
.administration-financial-grid,
.administration-system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.65rem;
}

.administration-team-card,
.administration-financial-grid > a,
.administration-system-card {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  background: var(--color-surface);
}

.administration-team-card:hover,
.administration-financial-grid > a:hover { color: var(--color-text); background: var(--color-surface-elevated); }
.administration-team-card > div { display: flex; justify-content: space-between; gap: 0.5rem; }
.administration-team-card > div b { color: var(--color-primary-strong); font-variant-numeric: tabular-nums; }
.administration-load-track { display: block; width: 100%; height: 0.5rem; overflow: hidden; border: 0; border-radius: 999px; color: var(--color-success); background: var(--color-surface-soft); appearance: none; }
.administration-load-track::-webkit-progress-bar { border-radius: inherit; background: var(--color-surface-soft); }
.administration-load-track::-webkit-progress-value { border-radius: inherit; background: currentColor; }
.administration-load-track::-moz-progress-bar { border-radius: inherit; background: currentColor; }
.administration-team-card.is-attention .administration-load-track { color: var(--color-warning); }
.administration-team-card.is-critical .administration-load-track { color: var(--color-danger); }
.administration-team-card dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.35rem; margin: 0; }
.administration-team-card dl div { display: flex; justify-content: space-between; gap: 0.4rem; font-size: 0.72rem; }
.administration-team-card dt { color: var(--color-muted); }
.administration-team-card dd { margin: 0; font-variant-numeric: tabular-nums; }

.administration-financial-grid > a span,
.administration-system-card > span { color: var(--color-muted); font-size: 0.76rem; font-weight: 700; }
.administration-financial-grid > a strong,
.administration-system-card > strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.administration-financial-grid > a small,
.administration-system-card > small { color: var(--color-muted); font-size: 0.72rem; }
.administration-system-card.is-critical { border-left: 4px solid var(--color-danger); }
.administration-system-card.is-ok { border-left: 4px solid var(--color-success); }
.administration-system-card.is-information { border-left: 4px solid var(--color-primary); }
.administration-system-card p { margin: 0; color: var(--color-danger); font-size: 0.76rem; }
.administration-system-card a { width: fit-content; font-size: 0.75rem; }
.administration-control-updated { margin: 0; text-align: right; }

body.theme-contrast .administration-summary-card,
body.theme-contrast .administration-alert,
body.theme-contrast .administration-team-card,
body.theme-contrast .administration-financial-grid > a,
body.theme-contrast .administration-system-card {
  border-width: 2px;
}

@media (max-width: 900px) {
  .administration-card-grid,
  .administration-change-columns { grid-template-columns: 1fr; }
  .administration-change-columns .administration-compact-list { max-height: none; }
}

@media (max-width: 680px) {
  .administration-control-toolbar,
  .administration-section-heading,
  .administration-dashboard-section-body-heading { align-items: stretch; flex-direction: column; }
  .administration-week-form { align-items: stretch; }
  .administration-week-form .field { width: 13.5rem; min-inline-size: min(100%, 13.5rem); flex: 1 1 13.5rem; }
  .administration-week-form .button { flex: 0 0 auto; }
  .administration-alert { grid-template-columns: 1fr; }
  .administration-alert-actions { justify-content: flex-start; flex-wrap: wrap; }
  .administration-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .administration-team-grid,
  .administration-financial-grid,
  .administration-system-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .administration-summary-strip { grid-template-columns: 1fr; }
  .administration-week-form { flex-direction: column; }
  .administration-week-form .field { width: 100%; min-inline-size: 0; flex: 0 1 auto; }
  .administration-week-form .button { width: 100%; }
  .administration-alert-actions { align-items: stretch; flex-direction: column; }
  .administration-alert-actions .button,
  .administration-alert-actions form { width: 100%; }
  .administration-snooze[open] form { position: static; width: 100%; max-width: 100%; flex-direction: column; margin-top: 0.35rem; }
  .administration-snooze input { width: 100%; }
  .administration-compact-list article { align-items: flex-start; flex-direction: column; }
}

/* Every appearance option uses the same semantic variables, so no screen
   changes structure when the user changes its visual mode. */
body.theme-light {
  --color-page: #eef3f8;
  --color-surface: #ffffff;
  --color-surface-elevated: #f7f9fc;
  --color-surface-soft: #e7eef7;
  --color-text: #152235;
  --color-muted: #526579;
  --color-border: #aab9ca;
  --color-primary: #cf6515;
  --color-primary-strong: #9e4705;
  --color-primary-soft: rgba(207, 101, 21, 0.13);
  --color-secondary: #e5edf6;
  --color-accent: #193d68;
  --planning-team-panel: #edf7fc;
  --planning-team-panel-border: #9fcce2;
  --planning-provider-panel: #fff4e9;
  --planning-provider-panel-border: #e7bc91;
  --shadow-soft: 0 12px 28px rgba(22, 41, 65, 0.16);
}

body.theme-light input,
body.theme-light select,
body.theme-light textarea {
  background: #ffffff;
}

body.theme-light .legacy-topbar {
  background: rgba(255, 255, 255, 0.96);
}

/* Keep native date controls legible against the dark form surface. */
body.theme-dark input[type="date"],
body.theme-dark input[type="datetime-local"],
body.theme-contrast input[type="date"],
body.theme-contrast input[type="datetime-local"] {
  color-scheme: dark;
}

body.theme-contrast {
  --color-page: #000000;
  --color-surface: #000000;
  --color-surface-elevated: #090909;
  --color-surface-soft: #111111;
  --color-text: #ffffff;
  --color-muted: #ffffff;
  --color-border: #ffffff;
  --color-primary: #ffd400;
  --color-primary-strong: #fff08a;
  --color-primary-soft: rgba(255, 212, 0, 0.25);
  --color-secondary: #111111;
  --color-accent: #ffffff;
  --color-success: #7fff00;
  --color-warning: #ffd400;
  --color-danger: #ff8a8a;
  --planning-team-panel: #000000;
  --planning-team-panel-border: var(--color-success);
  --planning-provider-panel: #000000;
  --planning-provider-panel-border: var(--color-primary);
  --shadow-soft: none;
}

body.theme-contrast input,
body.theme-contrast select,
body.theme-contrast textarea {
  border-width: 2px;
  background: #000000;
}

body.theme-contrast a {
  text-decoration: underline;
}

body.theme-contrast .legacy-topbar {
  background: #000000;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--color-page);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--color-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
  background: var(--color-page);
}

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

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

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

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  color: var(--color-text);
  background: #0b1623;
}

input::placeholder,
textarea::placeholder {
  color: #74849a;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(244, 124, 32, 0.32);
  outline-offset: 2px;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

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

.button-primary {
  color: #111c2b;
  background: var(--color-primary);
}

.button-primary:hover {
  color: #111c2b;
  background: var(--color-primary-strong);
}

.button-secondary {
  color: var(--color-text);
  background: var(--color-surface-soft);
  border-color: #394b61;
}

.button-danger {
  color: #fff;
  background: #ad2f3a;
}

.button-danger:hover {
  color: #fff;
  background: #8d2530;
}

.table-action-form { display: inline; }
.table-action-button { appearance: none; cursor: pointer; font: inherit; }

/* Annual vacations map: compact enough for an operational overview while
   retaining all twelve months and each user's balance. */
.vacation-header-panel,
.vacation-balance-panel {
  margin-bottom: 1rem;
}

.vacation-summary-grid {
  margin-top: 1rem;
}

.vacation-person-identity {
  margin: .25rem 0 0;
  color: var(--color-muted);
}

.vacation-person-identity strong {
  color: var(--color-text);
}

.vacation-year-form select {
  min-width: 7rem;
}

.vacation-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1rem;
}

.vacation-legend span {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: .3rem .65rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  font-size: .82rem;
  font-weight: 700;
}

.vacation-legend-approved { border-color: rgba(59, 184, 120, .75) !important; color: #a8e7c5 !important; }
.vacation-legend-pending { border-color: rgba(245, 185, 71, .8) !important; color: #ffdc8c !important; }
.vacation-legend-rejected { border-color: rgba(201, 65, 76, .8) !important; color: #ffd3d3 !important; }
.vacation-legend-cancelled { border-color: rgba(169, 182, 198, .6) !important; color: #c4cfdb !important; }
.vacation-legend-bridge { border-color: rgba(131, 108, 255, .78) !important; color: #c8bcff !important; }
.vacation-legend-absence { border-color: rgba(84, 171, 239, .8) !important; color: #a7dcff !important; }
.vacation-legend-holiday { border-color: rgba(222, 104, 104, .82) !important; color: #ffd0d0 !important; }
.vacation-legend-weekend { border-color: rgba(169, 182, 198, .5) !important; }

.vacation-approval-note {
  margin: .8rem 0 0;
  color: var(--color-muted);
  font-size: .86rem;
}

.vacation-settings-form,
.vacation-calendar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 1rem;
  padding: .8rem 1rem;
  border: 1px solid rgba(71, 111, 150, .58);
  border-radius: var(--radius);
  background: rgba(38, 76, 112, .12);
}

.vacation-monthly-report-form {
  display: grid;
  gap: .28rem;
  min-width: min(100%, 18rem);
}

.vacation-monthly-report-form small {
  max-width: 22rem;
  color: var(--color-muted);
  font-size: .72rem;
  line-height: 1.3;
}

.vacation-monthly-report-form[aria-busy="true"] .button {
  cursor: progress;
}

.vacation-settings-form > div,
.vacation-calendar-actions > div {
  display: grid;
  gap: .15rem;
  min-width: min(100%, 18rem);
  margin-right: auto;
}

.vacation-settings-form span,
.vacation-calendar-actions span {
  color: var(--color-muted);
  font-size: .78rem;
}

.vacation-settings-field,
.vacation-decision-reason {
  margin: 0;
}

.vacation-settings-field input {
  width: 5.2rem;
  min-width: 0;
}

.vacation-decision-reason input {
  min-width: min(100%, 15rem);
}

.vacation-selection-count {
  min-width: 8.8rem;
  color: #cde7ff !important;
  font-weight: 800;
  text-align: center;
}

.vacation-team-calendar { margin-bottom: 1rem; }

.vacation-team-month-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: .8rem;
  padding: 1rem;
}

.vacation-team-month { padding: .72rem; }

.vacation-month-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .45rem;
  margin-bottom: .6rem;
}

.vacation-month-heading h3 { margin-bottom: 0; }

.vacation-month-select {
  flex: 0 0 auto;
  padding: .28rem .42rem;
  font-size: .65rem;
}

.vacation-team-day {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  min-height: 3.1rem;
  padding: .18rem;
}

.vacation-team-day.is-empty { visibility: hidden; }

.vacation-team-day.is-selectable { cursor: pointer; }
.vacation-team-day.is-selectable:has(input:checked) {
  box-shadow: inset 0 0 0 2px #d9edff;
  background: rgba(107, 180, 243, .2);
}

.vacation-team-day:has(.vacation-team-chip input:checked),
.vacation-team-day:has(.vacation-team-count input:checked) {
  box-shadow: inset 0 0 0 2px #d9edff;
  background: rgba(107, 180, 243, .2);
}

.vacation-team-day-number {
  flex: 0 0 100%;
  color: var(--color-muted);
  font-size: .67rem;
  font-weight: 800;
  text-align: right;
}

.vacation-team-chip {
  display: inline-grid;
  place-items: center;
  min-width: 1.5rem;
  height: 1rem;
  padding: 0 .2rem;
  border: 1px solid var(--vacation-user-color, #376a9f);
  border-radius: 3px;
  color: #fff;
  background: var(--vacation-user-color, #376a9f);
  font-size: .56rem;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1;
}

.vacation-team-chip.is-pending {
  color: var(--vacation-user-color, #376a9f);
  background: transparent;
  border-style: dashed;
}

.vacation-team-chip.is-bridge {
  box-shadow: inset 0 -2px 0 #bcaeff;
}

.vacation-team-chip.is-selectable {
  position: relative;
  min-height: 1rem;
  cursor: pointer;
}

.vacation-team-chip.is-selectable input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vacation-team-chip.is-selectable:has(input:checked) {
  color: #11243a;
  border-color: #edf8ff;
  background: #a6d8ff;
  box-shadow: 0 0 0 2px #edf8ff;
}

/* A compact total replaces the initials when a calendar day is busy. The
   native tooltip keeps the people identifiable without making a day taller
   than its neighbours. */
.vacation-team-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.2rem;
  height: 1.2rem;
  margin: .08rem 0 0;
  padding: 0 .28rem;
  border: 1px solid color-mix(in srgb, var(--color-primary) 65%, var(--color-border));
  border-radius: 999px;
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-primary) 18%, transparent);
  font-size: .64rem;
  font-weight: 900;
  line-height: 1;
}

.vacation-team-count.is-pending {
  border-style: dashed;
}

.vacation-team-count.is-selectable {
  position: relative;
  cursor: pointer;
}

.vacation-team-count.is-selectable input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vacation-team-count.is-selectable:has(input:checked) {
  color: #11243a;
  border-color: #edf8ff;
  background: #a6d8ff;
  box-shadow: 0 0 0 2px #edf8ff;
}

.vacation-team-summary-inputs { display: none; }

.vacation-user-color-0 { --vacation-user-color: #376a9f; }
.vacation-user-color-1 { --vacation-user-color: #8a4d9e; }
.vacation-user-color-2 { --vacation-user-color: #a44c3e; }
.vacation-user-color-3 { --vacation-user-color: #287d68; }
.vacation-user-color-4 { --vacation-user-color: #a06a22; }
.vacation-user-color-5 { --vacation-user-color: #4f5f9d; }
.vacation-user-color-6 { --vacation-user-color: #237a97; }
.vacation-user-color-7 { --vacation-user-color: #a34e71; }
.vacation-user-color-8 { --vacation-user-color: #5c7e30; }
.vacation-user-color-9 { --vacation-user-color: #7d5a35; }
.vacation-user-color-10 { --vacation-user-color: #466f78; }
.vacation-user-color-11 { --vacation-user-color: #80518f; }

.vacation-allowance-form {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.vacation-allowance-form input {
  width: 4.4rem;
  min-width: 0;
  padding: .35rem .45rem;
}

.vacation-balance-table small {
  color: var(--color-muted);
}

.vacation-collapsible-panel {
  padding: 0;
  overflow: hidden;
}

.vacation-collapsible-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  cursor: pointer;
  list-style: none;
}

.vacation-collapsible-panel > summary::-webkit-details-marker { display: none; }

.vacation-collapsible-panel > summary > span:first-child {
  display: grid;
  gap: .18rem;
}

.vacation-collapsible-panel > summary small {
  color: var(--color-muted);
  font-size: .78rem;
}

.vacation-summary-count {
  flex: 0 0 auto;
  padding: .28rem .55rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  font-size: .76rem;
  font-weight: 800;
  white-space: nowrap;
}

.vacation-collapsible-content {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--color-border);
}

.vacation-collapsible-panel .table-scroll {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--color-border);
}

.vacation-user-list {
  display: grid;
  gap: 1rem;
}

.vacation-user-calendar {
  padding: 0;
  overflow: hidden;
}

.vacation-user-calendar summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  cursor: pointer;
  list-style: none;
  background: var(--color-surface-elevated);
  font-size: .95rem;
}

.vacation-user-calendar summary::-webkit-details-marker { display: none; }
.vacation-user-calendar summary::after { content: '⌄'; color: var(--color-primary-strong); font-size: 1.25rem; }
.vacation-user-calendar[open] summary::after { transform: rotate(180deg); }
.vacation-user-calendar summary small { color: var(--color-muted); }

.vacation-month-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: .8rem;
  padding: 1rem;
}

.vacation-month {
  min-width: 0;
  padding: .72rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: rgba(8, 17, 27, .42);
}

.vacation-month h3 {
  margin: 0 0 .6rem;
  font-size: .9rem;
}

.vacation-weekdays,
.vacation-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.vacation-weekdays {
  margin-bottom: 2px;
  color: var(--color-muted);
  font-size: .65rem;
  font-weight: 800;
  text-align: center;
}

.vacation-day {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 1.7rem;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--color-text);
  font-size: .72rem;
  line-height: 1;
}

.vacation-day.is-empty { visibility: hidden; }
.vacation-day.is-weekend { color: #78879a; background: rgba(169, 182, 198, .08); }
.vacation-day.is-holiday { color: #fff0f0; background: rgba(178, 65, 76, .64); font-weight: 800; }
.vacation-day.is-approved { color: #0a2518; background: #76d6a0; font-weight: 800; }
.vacation-day.is-pending { color: #372700; background: #ffd37c; font-weight: 800; }
.vacation-day.is-rejected { color: #fff; background: #8a3f49; font-weight: 800; }
.vacation-day.is-cancelled { color: #d5dce6; background: #46515f; text-decoration: line-through; }
.vacation-day.is-holiday { color: #fff0f0; background: rgba(178, 65, 76, .64); font-weight: 800; }
.vacation-day.is-selectable { cursor: pointer; }
.vacation-day.is-selectable input { position: absolute; opacity: 0; pointer-events: none; }
.vacation-day.is-selectable:has(input:checked) { color: #102235; background: #8dc7ff; box-shadow: inset 0 0 0 2px #d9edff; }
.vacation-request-form { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; padding: .75rem 1.15rem; color: var(--color-muted); border-bottom: 1px solid var(--color-border); font-size: .84rem; }
.vacation-request-form .button { margin-left: auto; }
.vacation-day.is-bridge { color: #20124c; background: #bcaeff; }
.vacation-day.is-absence { border-color: #63bff7; box-shadow: inset 0 0 0 1px rgba(99, 191, 247, .22); }
.vacation-day.is-approved.is-absence,
.vacation-day.is-pending.is-absence,
.vacation-day.is-bridge.is-absence { border-color: #0c73af; }
.vacation-day[href]:hover { color: #111c2b; filter: brightness(1.08); }

@media (max-width: 1280px) {
  .vacation-month-grid { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
  .vacation-team-month-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
}

@media (max-width: 860px) {
  .vacation-month-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .vacation-team-month-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .vacation-user-calendar summary { align-items: flex-start; flex-direction: column; }
  .vacation-settings-form,
  .vacation-calendar-actions { align-items: stretch; }
  .vacation-settings-form > div,
  .vacation-calendar-actions > div { min-width: 100%; }
  .vacation-selection-count { text-align: left; }
}

@media (max-width: 500px) {
  .vacation-month-grid { grid-template-columns: minmax(0, 1fr); }
  .vacation-team-month-grid { grid-template-columns: minmax(0, 1fr); }
  .vacation-allowance-form { width: 100%; justify-content: space-between; }
}

.button-ghost {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--color-border);
}

.alert {
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.alert-error {
  color: #ffd3d3;
  background: rgba(255, 102, 102, 0.12);
  border-color: rgba(255, 102, 102, 0.34);
}

.alert-warning {
  color: #ffe1a3;
  background: rgba(245, 185, 71, 0.12);
  border-color: rgba(245, 185, 71, 0.34);
  margin-bottom: 1.25rem;
}

.alert-success {
  color: #bcf1d3;
  background: rgba(59, 184, 120, 0.12);
  border-color: rgba(59, 184, 120, 0.34);
  margin-bottom: 1.25rem;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1.5rem;
  background: var(--color-page);
}

.auth-shell {
  width: min(100%, 440px);
}

.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.25rem;
}

.auth-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.auth-brand {
  display: grid;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.4rem;
}

.auth-logo {
  display: block;
  width: min(100%, 300px);
  max-height: 60px;
  object-fit: contain;
  object-position: left center;
}

.auth-brand p,
.topbar-kicker,
.brand small,
.nav-group p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.78rem;
}

.auth-brand h1,
.topbar h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.auth-brand h1 {
  font-size: 1.15rem;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--color-primary);
  font-weight: 800;
}

.form-stack {
  display: grid;
  gap: 0.7rem;
}

.form-stack label:not(.check-row) {
  font-weight: 700;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  color: var(--color-muted);
}

.check-row input {
  width: auto;
  min-height: auto;
  margin-top: 0.25rem;
}

.auth-note {
  margin: 1rem 0 0;
  color: var(--color-muted);
  font-size: 0.88rem;
}

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

.sidebar-backdrop {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 1rem;
  color: var(--color-text);
  background: var(--color-secondary);
}

.brand {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  min-height: 72px;
  margin-bottom: 1rem;
  color: #fff;
}

.brand-logo {
  display: block;
  width: min(100%, 230px);
  max-height: 48px;
  object-fit: contain;
  object-position: left center;
}

.brand strong {
  display: block;
  color: #fff;
  line-height: 1.2;
}

.side-nav {
  display: grid;
  gap: 0.65rem;
}

.nav-group {
  display: grid;
  gap: 0.42rem;
}

.nav-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.65rem;
  color: #94a4b8;
  cursor: pointer;
  list-style: none;
  text-transform: uppercase;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary span {
  font-size: 0.78rem;
  font-weight: 800;
}

.nav-group summary small,
.nav-link small,
.module-card small,
.module-group-header span,
.module-hero-stats span {
  border: 1px solid rgba(197, 207, 221, 0.22);
  border-radius: 999px;
  padding: 0.12rem 0.42rem;
  color: var(--color-accent);
  background: rgba(197, 207, 221, 0.07);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.35;
}

.nav-group-links {
  display: grid;
  gap: 0.22rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  min-height: 42px;
  border-radius: var(--radius);
  padding: 0.58rem 0.65rem;
  color: #e9eef5;
  transition: background 160ms ease, transform 160ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--color-text);
  background: rgba(244, 124, 32, 0.14);
  transform: translateX(2px);
}

.nav-link.is-active {
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.nav-link.is-unavailable {
  cursor: not-allowed;
  opacity: 0.48;
}

.nav-link span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.nav-link small {
  margin-left: auto;
  color: #f6c682;
  background: rgba(244, 124, 32, 0.1);
  border-color: rgba(244, 124, 32, 0.24);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 5px;
  opacity: 0.9;
}

.nav-icon-check {
  border-radius: 50%;
}

.nav-icon-check::after,
.nav-icon-user::after,
.nav-icon-settings::after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  margin: 4px auto;
  border-radius: 50%;
  background: currentColor;
}

.nav-icon-calendar,
.nav-icon-invoice,
.nav-icon-wallet {
  border-radius: 3px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 76px;
  padding: 0.85rem 1.25rem;
  background: rgba(8, 17, 27, 0.92);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}

.icon-button {
  display: inline-grid;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #394b61;
  border-radius: 6px;
  background: var(--color-surface-soft);
  color: var(--color-text);
  place-items: center;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: #111c2b;
  border-color: var(--color-primary-strong);
  background: var(--color-primary-strong);
  transform: translateY(-1px);
}

/* A single tooltip treatment for compact action icons. The accessible name
   remains in aria-label/title; this visual layer simply makes it discoverable
   without forcing labels into dense tables. */
[data-tooltip] { position: relative; }

@media (hover: hover) and (pointer: fine) {
  [data-tooltip]::after {
    position: absolute;
    z-index: 80;
    top: calc(100% + 0.48rem);
    left: 50%;
    width: max-content;
    max-width: min(18rem, calc(100vw - 2rem));
    padding: 0.38rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0.38rem;
    color: #f8fafc;
    background: #162333;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
    content: attr(data-tooltip);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.25;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    transform: translate(-50%, -0.2rem);
    transition: opacity 120ms ease 280ms, transform 120ms ease 280ms;
    white-space: normal;
  }

  [data-tooltip]:hover::after,
  [data-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.legacy-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: currentColor;
}

.hamburger::before,
.hamburger::after {
  content: "";
  margin-top: 5px;
}

.user-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  min-height: 40px;
  max-width: 180px;
  overflow: hidden;
  color: var(--color-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.user-chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip-compact-initials {
  display: none;
  color: var(--color-text);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.user-avatar,
.profile-avatar-preview {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border: 1px solid var(--color-primary-strong);
  border-radius: 50%;
  background: var(--color-surface-soft);
  color: var(--color-primary-strong);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  object-fit: cover;
}

.user-avatar-photo {
  display: block;
  object-fit: cover;
  background: var(--color-surface-elevated);
}

.user-list-identity {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.user-list-identity .user-competency-link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-login-unlock-form {
  flex: 0 0 auto;
  margin: 0;
}

.user-edit-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--color-primary) 34%, var(--color-border));
  border-left: 4px solid var(--color-primary-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--color-primary) 7%, var(--color-surface));
}

.user-edit-avatar {
  width: 4.75rem;
  height: 4.75rem;
  font-size: 1.12rem;
}

.user-edit-identity h3,
.user-edit-identity p {
  margin: 0;
}

.user-edit-identity h3 {
  overflow-wrap: anywhere;
  font-size: 1.2rem;
}

.user-edit-identity p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.28rem;
  color: var(--color-muted);
  font-size: 0.82rem;
}

body.theme-contrast .user-avatar {
  border-width: 2px;
  border-color: var(--color-text);
}

body.theme-contrast .user-edit-identity {
  border-width: 2px 2px 2px 5px;
  border-color: var(--color-text);
  background: var(--color-surface-elevated);
}

.profile-avatar-section {
  margin-top: 1rem;
}

.profile-avatar-section h3 {
  margin: 0;
}

.profile-avatar-section > p {
  margin: 0.3rem 0 0.85rem;
  color: var(--color-muted);
}

.profile-avatar-form {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: end;
  gap: 0.8rem;
}

.profile-avatar-preview {
  width: 68px;
  height: 68px;
  font-size: 1rem;
}

.customer-duplicate-check {
  margin-bottom: 1rem;
  border-color: var(--color-warning);
}

.customer-duplicate-check h3,
.customer-duplicate-check p {
  margin-top: 0;
}

.customer-duplicate-check p {
  color: var(--color-muted);
}

.customer-duplicate-list {
  display: grid;
  gap: 0.6rem;
}

.customer-duplicate-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 2fr) auto;
  gap: 0.35rem 0.8rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}

.customer-duplicate-item strong small,
.customer-duplicate-item span {
  color: var(--color-muted);
  font-size: 0.86rem;
}

.customer-duplicate-item span:nth-of-type(2) {
  grid-column: 1 / span 2;
}

.customer-duplicate-item .button {
  grid-row: 1 / span 2;
  grid-column: 3;
}

.customer-duplicate-confirm {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.8rem;
  color: var(--color-text);
}

.customer-duplicate-confirm input {
  width: auto;
  min-height: 0;
}

.customer-contact-requirements {
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(220, 63, 71, 0.72);
  border-left: 0.35rem solid var(--color-danger);
  border-radius: var(--radius);
  background: rgba(220, 63, 71, 0.08);
}

.customer-contact-requirements-eyebrow {
  color: var(--color-danger);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.customer-contact-requirements .check-row {
  align-items: start;
  color: var(--color-text);
}

.customer-contact-requirements .check-row input {
  width: auto;
  min-height: 0;
  margin-top: 0.2rem;
}

.customer-contact-requirements small {
  display: block;
  margin-top: 0.18rem;
  color: var(--color-muted);
  font-weight: 400;
}

.customer-merge-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.customer-merge-summary span,
.customer-merge-selected {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  color: var(--color-muted);
}

.customer-merge-summary strong,
.customer-merge-selected strong {
  color: var(--color-text);
}

.customer-merge-group-count {
  color: var(--color-muted);
}

.customer-merge-list {
  display: grid;
}

.customer-merge-list-head,
.customer-merge-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(210px, 1.8fr) minmax(100px, 0.7fr) 70px minmax(230px, auto);
  gap: 0.75rem;
  align-items: center;
}

.customer-merge-list-head {
  padding: 0 0.75rem 0.55rem;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.customer-merge-row {
  padding: 0.75rem;
  border-top: 1px solid var(--color-border);
  transition: background 150ms ease, box-shadow 150ms ease;
}

.customer-merge-row small {
  display: block;
  margin-top: 0.15rem;
  color: var(--color-muted);
}

.customer-merge-row.is-merge-keep {
  background: rgba(59, 184, 120, 0.1);
  box-shadow: inset 4px 0 0 var(--color-success);
}

.customer-merge-row.is-merge-delete {
  background: rgba(255, 102, 102, 0.1);
  box-shadow: inset 4px 0 0 var(--color-danger);
}

.customer-merge-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.customer-merge-row-actions .button {
  min-height: 34px;
  padding: 0.4rem 0.65rem;
  background: transparent;
}

.customer-merge-keep {
  border-color: var(--color-success);
  color: var(--color-success);
}

.customer-merge-delete {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.customer-merge-keep.is-selected {
  background: var(--color-success);
  color: #08111b;
}

.customer-merge-delete.is-selected {
  background: #ad2f3a;
  color: #fff;
}

.customer-merge-selection {
  position: sticky;
  z-index: 6;
  bottom: 0.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  margin: 1rem 0;
  padding: 0.85rem;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.customer-merge-selected-keep {
  border-left: 4px solid var(--color-success);
}

.customer-merge-selected-delete {
  border-left: 4px solid var(--color-danger);
}

.customer-merge-selection-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--color-muted);
  font-size: 0.86rem;
}

.user-menu {
  position: relative;
}

.user-menu summary {
  list-style: none;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-menu-caret {
  width: 0;
  height: 0;
  border-top: 5px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.user-menu-links {
  position: absolute;
  z-index: 8;
  top: calc(100% + 0.5rem);
  right: 0;
  display: none;
  width: min(280px, calc(100vw - 2rem));
  padding: 0.45rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

.user-menu[open] .user-menu-links {
  display: grid;
  gap: 0.18rem;
}

.user-menu-links > a,
.user-menu-links > span {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 38px;
  padding: 0.45rem 0.55rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--color-text);
  font-size: 0.88rem;
}

.user-menu-links > a:hover {
  background: rgba(244, 124, 32, 0.14);
}

.user-menu-links > .is-unavailable {
  cursor: not-allowed;
  opacity: 0.48;
}

.user-menu-links form {
  margin-top: 0.25rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--color-border);
}

.user-menu-links form .button {
  width: 100%;
}

.content-wrap {
  width: 100%;
  margin: 0;
  padding: 1.25rem;
}

.detail-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-header h2 {
  margin: 0.2rem 0 0;
  font-size: 1.7rem;
  line-height: 1.15;
}

.detail-header p {
  margin: 0.35rem 0 0;
  color: var(--color-muted);
}

.back-link {
  display: inline-flex;
  align-items: center;
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.back-link::before {
  content: "<";
  margin-right: 0.45rem;
  color: var(--color-primary);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
}

.project-customer-sheet-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.project-customer-sheet-file {
  display: grid;
  gap: 0.2rem;
  color: var(--color-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.project-customer-sheet-file input[type="file"] {
  max-width: 18rem;
  font: inherit;
  font-size: 0.78rem;
}

.detail-stats,
.detail-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.detail-panel {
  min-width: 0;
}

.project-pdf-customization-panel {
  grid-column: 1 / -1;
}

.project-pdf-customization-form {
  display: grid;
  gap: 0.9rem;
}

.project-pdf-customization-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.project-pdf-customization-fields small {
  color: var(--color-muted);
  font-size: 0.8rem;
}

.project-pdf-customization-actions {
  display: flex;
  justify-content: flex-end;
}

.detail-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.detail-field {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}

.detail-field span {
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.detail-field strong {
  min-width: 0;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.project-sales-off-form {
  display: grid;
  grid-template-columns: minmax(7rem, 0.7fr) minmax(10rem, 1fr) minmax(12rem, 1.45fr) auto;
  gap: 0.65rem;
  align-items: end;
  margin: 0.75rem 0 0;
  padding: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-primary-soft);
}

.project-sales-off-form header {
  display: grid;
  grid-column: 1 / -1;
  gap: 0.15rem;
}

.project-sales-off-form header strong {
  color: var(--color-text);
}

.project-sales-off-form header small,
.project-sales-off-form label span {
  color: var(--color-muted);
  font-size: 0.8rem;
}

.project-sales-off-form label {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.project-sales-off-form label em {
  font-style: normal;
  font-weight: 400;
}

.project-sales-off-form input,
.project-sales-off-form select {
  min-width: 0;
}

@media (max-width: 900px) {
  .project-sales-off-form {
    grid-template-columns: 1fr;
  }

  .project-sales-off-form button {
    justify-self: start;
  }
}

.project-opn-overview,
.project-opn-collapse {
  display: block;
  margin: 0 0 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}

.project-opn-overview > summary,
.project-opn-collapse > summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.project-opn-overview > summary::-webkit-details-marker,
.project-opn-collapse > summary::-webkit-details-marker {
  display: none;
}

.project-opn-overview > summary::before,
.project-opn-collapse > summary::before {
  content: "⌄";
  color: var(--color-primary-strong);
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.project-opn-overview:not([open]) > summary::before,
.project-opn-collapse:not([open]) > summary::before {
  transform: rotate(-90deg);
}

.project-opn-overview > summary small,
.project-opn-collapse > summary small {
  margin-left: auto;
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.project-opn-detail-grid {
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0 1rem 1rem;
}

.project-opn-detail-grid .detail-fields {
  grid-template-columns: 1fr;
  gap: 0;
}

.project-opn-detail-grid .detail-field {
  grid-template-columns: minmax(10rem, 32%) minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  padding: 0.45rem 0;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
}

.project-opn-detail-grid .detail-field:last-child {
  border-bottom: 0;
}

.detail-field-editable .project-inline-value {
  cursor: pointer;
}

.detail-field-editable .project-inline-value:hover {
  color: var(--color-primary-strong);
}

.detail-field-requester {
  grid-column: 1 / -1;
}

.project-requester-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.project-requester-value .table-action-icon {
  flex: 0 0 auto;
}

.project-requester-editor {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.45rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--color-border);
}

.project-requester-editor[hidden] {
  display: none;
}

.project-requester-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.project-requester-selection,
.project-requester-status {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.project-requester-status.is-success {
  color: var(--color-primary-strong);
}

.project-requester-status.is-error {
  color: var(--color-danger, #b42318);
}

.project-inline-value.is-editing {
  display: block;
}

.project-inline-input {
  width: 100%;
  min-width: 0;
  font: inherit;
}

.project-delivery-reason {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.3rem;
  padding: 0.7rem;
  border: 1px solid color-mix(in srgb, var(--color-primary) 48%, var(--color-border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--color-primary-soft) 58%, var(--color-surface-elevated));
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.14);
}

.project-delivery-reason > label {
  color: var(--color-text);
  font-size: 0.84rem;
  font-weight: 800;
}

.project-delivery-reason-help,
.project-delivery-reason-error {
  margin: 0;
  font-size: 0.78rem;
}

.project-delivery-reason-help {
  color: var(--color-muted);
}

.project-delivery-reason-error {
  color: var(--color-danger);
  font-weight: 700;
}

.project-delivery-reason textarea {
  min-height: 5.5rem;
  padding: 0.55rem 0.65rem;
}

.project-delivery-reason-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.project-delivery-reason-actions .button {
  min-height: 2.2rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
}

.project-opn-detail-grid .project-delivery-reason {
  grid-column: 2;
}

@media (max-width: 640px) {
  .project-opn-detail-grid .project-delivery-reason {
    grid-column: 1 / -1;
  }

  .project-delivery-reason-actions .button {
    flex: 1 1 auto;
  }
}

.project-inline-value.is-saving {
  opacity: 0.7;
}

.task-time-duration-cell {
  min-width: 8.5rem;
}

.task-time-duration-value {
  min-height: 1.8rem;
  margin: -0.25rem;
  padding: 0.25rem;
  border: 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--color-primary) 58%, transparent);
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: text;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.task-time-duration-value:hover,
.task-time-duration-value:focus-visible {
  color: var(--color-primary-strong);
}

.task-time-duration-input {
  width: 100%;
  min-width: 7.5rem;
  font: inherit;
}

.task-time-duration-cell.is-saving {
  opacity: 0.7;
}

.task-time-duration-status {
  margin: 0.45rem 0;
  color: var(--color-muted);
  font-size: 0.86rem;
}

.task-time-duration-status.is-error {
  color: var(--color-danger);
  font-weight: 700;
}

.task-time-duration-reason {
  display: grid;
  gap: 0.45rem;
  min-width: min(24rem, 76vw);
  margin-top: 0.55rem;
  padding: 0.7rem;
  border: 1px solid color-mix(in srgb, var(--color-warning) 56%, var(--color-border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--color-warning) 14%, var(--color-surface-elevated));
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.14);
}

.task-time-duration-reason > label {
  color: var(--color-text);
  font-size: 0.84rem;
  font-weight: 800;
}

.task-time-duration-reason-help,
.task-time-duration-reason-error {
  margin: 0;
  font-size: 0.78rem;
}

.task-time-duration-reason-help {
  color: var(--color-muted);
}

.task-time-duration-reason-error {
  color: var(--color-danger);
  font-weight: 700;
}

.task-time-duration-reason textarea {
  width: 100%;
  min-height: 5.5rem;
  padding: 0.55rem 0.65rem;
  resize: vertical;
}

.task-time-duration-reason-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.task-time-duration-reason-actions .button {
  min-height: 2.2rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
}

@media (max-width: 640px) {
  .task-time-duration-reason {
    min-width: min(20rem, 72vw);
  }

  .task-time-duration-reason-actions .button {
    flex: 1 1 auto;
  }
}

.project-inline-status {
  margin: 0 0 0.8rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.project-inline-status.project-inline-success {
  color: #bcf1d3;
}

.project-inline-status.project-inline-error {
  color: #ffd3d3;
}

.detail-note {
  margin: 0.65rem 0 0;
  color: var(--color-muted);
  overflow-wrap: anywhere;
}

.timeline-list {
  display: grid;
  gap: 0.75rem;
}

.timeline-item {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}

.timeline-item div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
}

.timeline-item strong {
  color: var(--color-text);
}

.timeline-item span,
.timeline-item p {
  color: var(--color-muted);
}

.timeline-item-deadline-change {
  border-left: 3px solid #b794f4;
  background: rgba(183, 148, 244, 0.12);
}

.timeline-item-task-validation {
  border-left: 3px solid #f5c451;
  background: rgba(245, 196, 81, 0.12);
}

.project-final-analysis-current { border-left: 3px solid #38a169; }
.project-final-analysis-stale { border-left: 3px solid #ed8936; background: rgba(237, 137, 54, 0.1); }
.project-final-analysis-values { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; margin-top: 0.45rem; color: var(--color-muted); font-size: 0.84rem; }
.project-final-analysis-values strong { color: var(--color-text); }
.project-note-image-link { display: block; width: fit-content; max-width: min(100%, 42rem); margin-top: 0.6rem; }
.project-note-image { display: block; max-width: 100%; max-height: 34rem; border: 1px solid var(--color-border); border-radius: 0.5rem; object-fit: contain; background: var(--color-surface); }
.project-note-inline-image { display: grid; gap: 0.55rem; width: min(100%, 46rem); margin-top: 0.85rem; padding: 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface-elevated); }
.project-note-inline-image[hidden] { display: none !important; }
.project-note-inline-image-header { display: grid; gap: 0.18rem; }
.project-note-inline-image-header strong { color: var(--color-text); overflow-wrap: anywhere; }
.project-note-inline-image-header small { color: var(--color-muted); }
.project-note-inline-image > a { display: block; width: fit-content; max-width: 100%; }
.project-note-inline-image img { display: block; max-width: 100%; max-height: 32rem; border: 1px solid var(--color-border); border-radius: 0.45rem; object-fit: contain; background: var(--color-surface); }

.timeline-item p {
  margin: 0;
  overflow-wrap: anywhere;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric-card,
.panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.metric-card {
  min-height: 112px;
  padding: 1rem;
  border-top: 4px solid var(--color-primary);
}

.metric-card span {
  display: block;
  color: var(--color-muted);
  font-size: 0.88rem;
}

.metric-card strong {
  display: block;
  margin-top: 0.55rem;
  font-size: 2rem;
  line-height: 1;
}

.dashboard-profile-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-profile-intro h2 {
  margin: 0;
  font-size: 1.15rem;
}

.dashboard-profile-intro p {
  margin: .2rem 0 0;
  color: var(--color-muted);
}

.dashboard-profile-intro .eyebrow {
  margin: 0 0 .3rem;
}

.dashboard-profile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
}

.dashboard-metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.dashboard-metric-link {
  display: block;
  color: var(--color-text);
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.dashboard-metric-link:hover,
.dashboard-metric-link:focus-visible {
  color: var(--color-text);
  transform: translateY(-2px);
  border-color: rgba(244, 124, 32, .68);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .28);
}

.dashboard-metric-link small {
  display: block;
  margin-top: .48rem;
  color: var(--color-muted);
  font-size: .74rem;
  line-height: 1.35;
}

.metric-danger {
  border-top-color: var(--color-danger);
}

.metric-accent {
  border-top-color: var(--color-accent);
}

.metric-success {
  border-top-color: var(--color-success);
}

.metric-warning {
  border-top-color: #d99222;
}

.metric-neutral {
  border-top-color: var(--color-accent);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-work-grid {
  margin-top: 1rem;
}

.panel {
  padding: 1rem;
}

.panel-wide {
  grid-column: 1 / -1;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.panel-header-wrap {
  align-items: center;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.08rem;
}

.panel-header p {
  margin: 0.2rem 0 0;
  color: var(--color-muted);
}

.list-stack {
  display: grid;
  gap: 0.65rem;
}

.list-item {
  display: grid;
  gap: 0.15rem;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}

.list-item span,
.list-item small,
.empty-state {
  color: var(--color-muted);
}

.dashboard-project-search {
  display: flex;
  align-items: end;
  gap: 0.55rem;
  min-width: min(100%, 430px);
}

.dashboard-project-search .field {
  flex: 1;
  margin: 0;
}

.dashboard-project-search input {
  min-width: 260px;
}

.dashboard-assigned-projects-table th:nth-child(1) { width: 28%; }
.dashboard-assigned-projects-table th:nth-child(2) { width: 36%; }
.dashboard-assigned-projects-table th:nth-child(3) { width: 36%; }
.dashboard-assigned-projects-table td small {
  display: block;
  margin-top: 0.22rem;
  color: var(--color-muted);
}

.dashboard-messages-menu { margin-top: 1rem; padding: 0; overflow: hidden; }
.dashboard-messages-menu > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .7rem; padding: 1rem; cursor: pointer; list-style: none; }
.dashboard-messages-menu > summary::-webkit-details-marker { display: none; }
.dashboard-messages-menu > summary::after { content: '+'; color: var(--color-primary); font-size: 1.15rem; font-weight: 900; }
.dashboard-messages-menu[open] > summary { border-bottom: 1px solid var(--color-border); background: var(--color-surface-elevated); }
.dashboard-messages-menu[open] > summary::after { content: '−'; }
.dashboard-summary-icon { width: 2.15rem; height: 2.15rem; flex: 0 0 auto; padding: .43rem; overflow: visible; border: 1px solid rgba(140, 177, 206, .38); border-radius: .55rem; color: var(--color-primary); background: rgba(140, 177, 206, .08); stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-messages-menu > summary strong,
.dashboard-messages-menu > summary small { display: block; }
.dashboard-messages-menu > summary small { margin-top: .16rem; color: var(--color-muted); }
.dashboard-messages-menu-body { display: grid; gap: .8rem; padding: 1rem; }
.dashboard-messages-menu-body > p { margin: 0; color: var(--color-muted); }
.dashboard-messages-menu-links { display: grid; grid-template-columns: minmax(13rem, 1.2fr) repeat(3, minmax(10rem, 1fr)); gap: .65rem; }
.dashboard-message-link { display: grid; gap: .18rem; min-width: 0; padding: .75rem; border: 1px solid var(--color-border); border-radius: var(--radius); color: var(--color-text); background: var(--color-surface-elevated); }
.dashboard-message-link:hover { color: var(--color-text); border-color: rgba(244, 124, 32, .58); background: #1a293d; }
.dashboard-message-link small { color: var(--color-muted); }
.dashboard-message-link.is-primary { border-color: rgba(244, 124, 32, .54); background: rgba(244, 124, 32, .1); }

.message-scope-tabs { display: flex; flex-wrap: wrap; gap: .45rem; margin: -.15rem 0 .95rem; }
.message-scope-tabs a { padding: .42rem .64rem; border: 1px solid var(--color-border); border-radius: 999px; color: var(--color-muted); font-size: .79rem; font-weight: 800; }
.message-scope-tabs a:hover { color: var(--color-text); border-color: rgba(244, 124, 32, .55); }
.message-scope-tabs a.is-active { border-color: rgba(244, 124, 32, .68); color: var(--color-primary-strong); background: rgba(244, 124, 32, .13); }
.messages-pagination { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; padding: .7rem .85rem; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); color: var(--color-muted); font-size: .82rem; }
.messages-pagination > div { display: flex; flex-wrap: wrap; gap: .45rem; }

.list-item strong,
.list-item span,
.list-item small {
  overflow-wrap: anywhere;
}

.dashboard-work-item > a {
  width: fit-content;
  max-width: 100%;
  color: var(--color-text);
}

.dashboard-work-item > a:hover,
.dashboard-work-item > a:focus-visible {
  color: var(--color-primary-strong);
}

.project-payment-condition-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.project-payment-condition-item > div {
  display: grid;
  gap: 0.15rem;
}

.project-payment-condition-item form {
  margin: 0;
}

.project-payment-condition-item.is-removing {
  opacity: 0.7;
}

.project-payment-condition-status {
  margin: 0.7rem 0 0;
  color: var(--color-muted);
  font-size: 0.88rem;
}

.project-payment-condition-status.is-success {
  color: #bcf1d3;
}

.project-payment-condition-status.is-error {
  color: #ffd3d3;
}

.search-form {
  display: flex;
  width: min(100%, 420px);
  gap: 0.55rem;
}

.report-filter-panel {
  margin-bottom: 1rem;
}

.report-filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 0.75rem;
}

.report-filter-form .field {
  gap: 0.35rem;
}

.report-filter-actions {
  flex-wrap: nowrap;
  padding: 0;
}

.report-metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-selection-actions {
  justify-content: flex-end;
  margin-top: 0.8rem;
}

.payment-note-settlement {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(180px, 0.45fr) minmax(260px, 1.2fr);
  align-items: end;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 0.65rem;
  background: var(--color-surface-soft);
}

.payment-note-settlement .field {
  gap: 0.35rem;
}

.payment-note-settlement p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.external-task-payment-selection {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  margin: 0.85rem 0 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--color-surface-elevated) 0%, var(--color-surface-soft) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.external-task-payment-selection h3,
.external-task-payment-selection p {
  margin: 0;
}

.external-task-payment-selection h3 {
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.external-task-payment-selection p {
  margin-top: 0.25rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.external-task-payment-settlement {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.7rem 1rem;
  margin-top: 0.8rem;
}

.external-task-payment-settlement label {
  display: grid;
  gap: 0.3rem;
  min-width: 10.5rem;
  color: var(--color-muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.external-task-payment-settlement input {
  width: 8.5rem;
  min-height: 2.35rem;
}

.external-task-payment-selection .external-task-payment-settlement p {
  flex: 1 1 17rem;
  margin: 0 0 0.15rem;
  color: var(--color-text);
  font-size: 0.86rem;
  font-weight: 650;
}

.email-payment-request-summary {
  display: grid;
  grid-template-columns: auto auto minmax(12rem, 1fr);
  align-items: baseline;
  gap: 0.45rem 0.85rem;
  margin: 0 0 1rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 0.65rem;
  background: var(--color-surface-soft);
}

.email-payment-request-summary > span,
.email-payment-request-summary small {
  color: var(--color-muted);
  font-size: 0.84rem;
}

.email-payment-request-summary strong {
  color: var(--color-text);
  font-size: 1.05rem;
}

.email-provider-invoice-next-step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1rem;
    padding: 0.85rem 0.95rem;
  border: 1px solid var(--color-border);
  border-radius: 0.65rem;
    background: var(--color-surface-soft);
}

.email-provider-invoice-next-step > div { display: grid; gap: .2rem; }
.email-provider-invoice-next-step span { color: var(--color-muted); font-size: .82rem; }

.email-payment-note-preview { overflow: hidden; margin: 0 0 1rem; }
.email-payment-note-preview-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--color-border); background: var(--color-surface-soft); }
.email-payment-note-preview-header h3 { margin: 0; }
.email-payment-note-preview-header p { margin: .25rem 0 0; color: var(--color-muted); font-size: .86rem; }
.email-payment-note-preview-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.email-payment-note-preview-frame { display: block; width: 100%; height: min(76vh, 58rem); min-height: 34rem; border: 0; background: #fff; }
.email-payment-note-validation { overflow: hidden; margin: 0 0 1rem; border-color: var(--color-primary); }
.email-payment-note-validation-content { display: grid; gap: 1rem; padding: 1rem; }
.email-payment-note-validation-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin: 0; }
.email-payment-note-validation-summary > div { min-width: 0; padding: .7rem .75rem; border: 1px solid var(--color-border); border-radius: .55rem; background: var(--color-surface-soft); }
.email-payment-note-validation-summary dt { color: var(--color-muted); font-size: .76rem; font-weight: 700; }
.email-payment-note-validation-summary dd { margin: .22rem 0 0; overflow-wrap: anywhere; color: var(--color-text); font-size: .9rem; font-weight: 720; }
.email-payment-note-validation-items,
.email-payment-note-validation-audit { display: grid; gap: .5rem; }
.email-payment-note-validation-items h4,
.email-payment-note-validation-audit h4 { margin: 0; font-size: .92rem; }
.email-payment-note-validation-items article { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .18rem .75rem; padding: .68rem .75rem; border: 1px solid var(--color-border); border-radius: .55rem; background: var(--color-surface); }
.email-payment-note-validation-items article strong,
.email-payment-note-validation-items article span { min-width: 0; overflow-wrap: anywhere; }
.email-payment-note-validation-items article span { color: var(--color-muted); font-size: .84rem; }
.email-payment-note-validation-items article small { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--color-text); font-weight: 760; white-space: nowrap; }
.email-payment-note-validation-audit p { display: flex; flex-wrap: wrap; gap: .3rem .6rem; margin: 0; padding: .58rem .7rem; border-left: 3px solid var(--color-primary); background: var(--color-surface-soft); }
.email-payment-note-validation-audit span { color: var(--color-muted); font-size: .84rem; }
.email-payment-note-validation-actions { display: flex; flex-wrap: wrap; gap: .6rem; padding: 1rem; border-top: 1px solid var(--color-border); background: var(--color-surface-soft); }
.email-payment-note-validation-actions form { margin: 0; }

.payment-note-invoice-page { max-width: 56rem; }
.payment-note-invoice-intro { max-width: 46rem; margin: 0 0 1rem; color: var(--color-muted); }
.payment-note-invoice-current { margin: 0 0 1rem; padding: .7rem .8rem; border: 1px solid var(--color-border); border-radius: .55rem; background: var(--color-surface-soft); }
.payment-note-invoice-current a { color: var(--color-primary-strong); font-weight: 750; }
.payment-note-invoice-form { display: grid; gap: .8rem; max-width: 36rem; }
.payment-note-invoice-form .field { margin: 0; }

.external-task-payment-selection .button {
  min-width: 13.5rem;
  white-space: nowrap;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
}

.external-task-payment-selection .button:disabled {
  cursor: not-allowed;
  border-color: var(--color-border);
  color: var(--color-muted);
  background: var(--color-secondary);
  box-shadow: none;
  opacity: 1;
}

.balance-filter-form {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.balance-advanced-filter-panel > summary {
  background: var(--color-surface-soft);
}

.balance-advanced-filter-panel > .balance-advanced-filter-content {
  padding: 0.9rem 1rem 1rem;
}

.balance-filter-form .report-filter-actions {
  grid-column: span 2;
  justify-content: flex-end;
}

.balance-export-menu {
  position: relative;
}

.balance-export-menu > summary {
  list-style: none;
}

.balance-export-menu > summary::-webkit-details-marker {
  display: none;
}

.balance-export-menu > summary::after {
  margin-left: 0.45rem;
  content: "▾";
}

.balance-export-menu[open] > summary::after {
  content: "▴";
}

.balance-export-menu-options {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.35rem);
  right: 0;
  display: grid;
  min-width: 168px;
  padding: 0.35rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.balance-export-menu-options a {
  padding: 0.55rem 0.65rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--color-text);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.balance-export-menu-options a:hover,
.balance-export-menu-options a:focus-visible {
  color: #fff;
  background: var(--color-accent);
}

.metric-grid.balance-metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  align-items: stretch;
}

.balance-metric-grid .metric-card {
  min-width: 0;
}

.balance-metric-grid .metric-card strong {
  overflow-wrap: anywhere;
}

.balance-provider-receipt-alerts {
  margin-bottom: 1rem;
  border-top: 3px solid var(--color-primary);
}

.balance-provider-payment-note-invoice-alerts {
  margin-bottom: 1rem;
  border-top: 3px solid var(--color-warning, #f0a000);
}

.balance-provider-receipt-alerts > summary {
  background: rgba(255, 160, 0, 0.08);
}

.balance-provider-payment-note-invoice-alerts > summary {
  background: rgba(240, 160, 0, 0.1);
}

.balance-provider-receipt-alert-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  min-width: 2.1rem;
  min-height: 1.55rem;
  padding: 0.1rem 0.34rem;
  border: 1px solid rgba(255, 160, 0, 0.78);
  border-radius: 999px;
  background: rgba(255, 160, 0, 0.16);
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  animation: balance-provider-receipt-pulse 1.35s ease-in-out infinite;
}

.balance-provider-payment-note-invoice-alert-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-width: 2.8rem;
  padding: 0.3rem 0.48rem;
  border: 1px solid rgba(240, 160, 0, 0.55);
  border-radius: 999px;
  color: var(--color-primary-strong);
  background: rgba(240, 160, 0, 0.13);
}

.balance-provider-payment-note-invoice-alert-count b {
  color: var(--color-primary-strong);
  font-size: 0.72rem;
}

.balance-provider-receipt-alert-count b {
  color: var(--color-primary-strong);
  font-size: 0.72rem;
}

.balance-provider-receipt-alert-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 0.75rem;
}

.balance-provider-receipt-alert-card {
  display: grid;
  gap: 0.72rem;
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid rgba(255, 160, 0, 0.48);
  border-radius: calc(var(--radius) - 1px);
  background: var(--color-surface-elevated);
}

.balance-provider-receipt-alert-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.58rem;
  min-width: 0;
}

.balance-provider-receipt-alert-card-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2rem;
  min-height: 2rem;
  border-radius: 50%;
  background: rgba(255, 160, 0, 0.16);
  font-size: 1rem;
}

.balance-provider-receipt-alert-card h3 {
  margin: 0;
  font-size: 0.98rem;
}

.balance-provider-receipt-alert-card h3 a {
  color: var(--color-text);
}

.balance-provider-receipt-alert-card h3 a:hover,
.balance-provider-receipt-alert-card h3 a:focus-visible {
  color: var(--color-primary-strong);
}

.balance-provider-receipt-alert-card p {
  margin: 0.18rem 0 0;
  color: var(--color-muted);
  font-size: 0.77rem;
  line-height: 1.35;
}

.balance-provider-receipt-alert-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.52rem;
  margin: 0;
}

.balance-provider-receipt-alert-details div {
  min-width: 0;
}

.balance-provider-receipt-alert-details dt {
  color: var(--color-muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.balance-provider-receipt-alert-details dd {
  margin: 0.15rem 0 0;
  color: var(--color-text);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.balance-provider-receipt-alert-details dd small {
  display: block;
  margin-top: 0.12rem;
  color: var(--color-muted);
  font-size: 0.69rem;
}

.balance-provider-receipt-alert-action {
  justify-self: start;
  white-space: nowrap;
}

.balance-report-header {
  align-items: center;
}

.balance-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
  color: var(--color-muted);
  font-size: 0.78rem;
}

.balance-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.balance-legend span::before {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 3px;
  content: '';
}

.balance-legend-warning::before {
  background: rgba(217, 169, 48, 0.58);
}

.balance-legend-danger::before {
  background: rgba(201, 65, 76, 0.65);
}

.balance-table-scroll {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

.balance-data-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: 0.76rem;
}

.balance-data-table th,
.balance-data-table td {
  min-width: 0;
  padding: 0.55rem 0.42rem;
  overflow-wrap: anywhere;
}

.balance-data-table .table-sort,
.balance-data-table .table-sort > span:first-child {
  min-width: 0;
}

.balance-data-table .table-sort > span:first-child {
  overflow-wrap: anywhere;
}

.balance-data-table thead th {
  font-size: 0.7rem;
  text-transform: uppercase;
}

/* Keep both rows of the balance header together below the persistent CRM
   navigation. The mobile layout replaces the table with labelled cards, so
   the sticky table header only applies while the tabular layout is visible. */
@media (min-width: 861px) {
  .balance-data-table thead {
    position: sticky;
    z-index: 20;
    top: calc(var(--temporary-access-banner-height) + var(--legacy-topbar-height));
  }

  .balance-data-table thead th {
    background: var(--color-surface-elevated);
  }

  .balance-data-table thead tr:last-child th,
  .balance-data-table thead tr:first-child th[rowspan="2"] {
    border-bottom: 2px solid var(--color-border);
  }
}

.balance-data-table .balance-group-heading {
  text-align: center;
}

.balance-data-table .balance-group-heading .table-sort {
  justify-content: center;
}

.balance-data-table th.balance-money .table-sort {
  justify-content: flex-end;
}

.balance-data-table .balance-column-expand { width: 3%; }
.balance-data-table .balance-column-reference { width: 8%; }
.balance-data-table .balance-column-customer { width: 10%; }
.balance-data-table .balance-column-billing-customer { width: 12%; }
.balance-data-table .balance-column-email { width: 12%; }
.balance-data-table .balance-column-city { width: 6%; }
.balance-data-table .balance-column-tasks { width: 5%; }
.balance-data-table .balance-column-billed { width: 8%; }
.balance-data-table .balance-column-budget-normal,
.balance-data-table .balance-column-budget-off,
.balance-data-table .balance-column-debt-normal,
.balance-data-table .balance-column-debt-off { width: 8%; }
.balance-data-table .balance-column-actions { width: 4%; }

.balance-money {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.balance-data-table .balance-money {
  overflow-wrap: anywhere;
  white-space: normal;
}

.balance-reference-link {
  min-height: 29px;
  padding: 0.25rem 0.38rem;
  font-size: 0.72rem;
}

.balance-task-state {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  color: var(--color-muted);
  font-weight: 700;
}

.balance-task-state-done {
  color: var(--color-success);
}

.balance-row-warning > * {
  background: rgba(217, 169, 48, 0.12);
}

.balance-row-danger > * {
  background: rgba(201, 65, 76, 0.16);
}

.balance-data-table tfoot th {
  border-top: 2px solid var(--color-border);
  color: var(--color-text);
  background: var(--color-surface-elevated);
}

.balance-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
}

.balance-row-priority-actions,
.balance-row-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.24rem;
}

.balance-row-priority-actions {
  margin-right: auto;
}

.balance-row-secondary-actions {
  margin-left: auto;
  justify-content: flex-end;
}

.balance-actions-row > td {
  padding-block: 0.3rem;
}

.balance-content-row > .balance-content-spacer {
  padding: 0;
}

.balance-data-table .balance-expand-heading {
  box-sizing: border-box;
  width: 26px;
  min-width: 26px;
  max-width: 26px;
  text-align: center;
}

.balance-opn-action {
  width: auto;
  min-width: 2.6rem;
  padding-inline: 0.32rem;
  font-size: 0.64rem;
}

/* A client receipt unlocks the provider-payment workflow. The action row has
   limited room, so it keeps a compact pulsing bell; the full message lives in
   the Providers card after the financial detail is opened. */
.balance-provider-receipt-alert {
  display: inline-grid;
  place-items: center;
  width: 29px;
  min-height: 29px;
  padding: 0;
  border: 1px solid rgba(255, 160, 0, 0.78);
  border-radius: 0.42rem;
  background: rgba(255, 160, 0, 0.16);
  color: var(--color-text);
  font-size: 0.69rem;
  line-height: 1.14;
  text-decoration: none;
  animation: balance-provider-receipt-pulse 1.35s ease-in-out infinite;
}

.balance-provider-receipt-alert:hover,
.balance-provider-receipt-alert:focus-visible {
  border-color: var(--color-primary);
  background: rgba(255, 160, 0, 0.25);
  color: var(--color-text);
}

.balance-provider-receipt-alert-icon { font-size: 0.9rem; }

.balance-provider-payment-note-invoice-alert-card-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: rgba(240, 160, 0, 0.16);
  font-size: 1rem;
}

.balance-provider-payment-note-invoice-alert {
  display: inline-grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid rgba(240, 160, 0, 0.62);
  border-radius: 50%;
  color: var(--color-primary-strong);
  background: rgba(240, 160, 0, 0.12);
  text-decoration: none;
}

.balance-provider-payment-note-invoice-alert:hover,
.balance-provider-payment-note-invoice-alert:focus-visible {
  border-color: var(--color-primary);
  background: rgba(240, 160, 0, 0.26);
  color: var(--color-text);
}

@keyframes balance-provider-receipt-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 160, 0, 0); }
  50% { box-shadow: 0 0 0 0.28rem rgba(255, 160, 0, 0.2); }
}

.balance-expand-button {
  cursor: pointer;
}

.balance-expand-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.balance-agent-invoice-field {
  max-width: 18rem;
  margin: 0.7rem 0 0;
}

.payment-note-invoice-number {
  display: block;
  margin-top: 0.2rem;
  color: var(--color-muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.provider-payment-note-list {
  display: grid;
  justify-items: start;
  gap: 0.22rem;
}

.provider-payment-note-link {
  color: var(--color-primary-strong);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.3;
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.provider-payment-note-link:hover,
.provider-payment-note-link:focus-visible {
  color: var(--color-accent);
}

.payment-note-invoice-download {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: 0.3rem 0.25rem 0 0;
  padding: 0.1rem 0.32rem;
  border: 1px solid var(--color-border);
  border-radius: 0.3rem;
  color: var(--color-accent);
  background: var(--color-surface-soft);
  font-size: 0.66rem;
  font-weight: 800;
  text-decoration: none;
}

.payment-note-invoice-download:hover,
.payment-note-invoice-download:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-surface);
  background: var(--color-accent);
}

.payment-note-invoice-register {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: 0.3rem 0.25rem 0 0;
  padding: 0.1rem 0.32rem;
  border: 1px dashed var(--color-accent);
  border-radius: 0.3rem;
  color: var(--color-primary-strong);
  font-size: 0.66rem;
  font-weight: 800;
  text-decoration: none;
}

.payment-note-invoice-register:hover,
.payment-note-invoice-register:focus-visible {
  border-style: solid;
  color: var(--color-surface);
  background: var(--color-accent);
}

.balance-detail-row > td {
  padding: 0 !important;
  background: var(--color-surface-elevated) !important;
}

.balance-detail-row-error > td {
  padding: 0.85rem 1rem !important;
  color: var(--color-danger);
}

.external-task-project-scope {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.85rem;
  margin: 0.25rem 0 1rem;
  color: var(--color-muted);
  font-size: 0.86rem;
}

.external-task-project-scope > span {
  color: var(--color-text);
  font-weight: 750;
}

.external-task-project-table-scroll {
  overflow: visible;
}

.external-task-expand-heading,
.external-task-project-table > tbody > .external-task-project-row > td:first-child {
  width: 34px;
  text-align: center;
}

.external-task-expand-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface-elevated);
  color: var(--color-accent);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

.external-task-expand-button:hover,
.external-task-expand-button:focus-visible {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-surface);
}

.external-task-expand-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.external-task-project-row.has-pending-payment > * {
  background: rgba(217, 169, 48, 0.08);
}

.external-task-project-reference {
  color: var(--color-text);
  font-weight: 760;
}

.external-task-number {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.external-task-pending.is-pending {
  color: var(--color-warning);
  font-weight: 780;
}

.external-task-project-details-row > td {
  padding: 0 !important;
  background: var(--color-surface-elevated) !important;
}

.external-task-project-details-row-error > td {
  padding: 0.85rem 1rem !important;
  color: var(--color-danger);
}

.external-task-project-details {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-top: 2px solid var(--color-accent);
}

.external-task-project-details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.external-task-project-details-header h3,
.external-task-project-details-header p {
  margin: 0;
}

.external-task-project-details-header p {
  margin-top: 0.2rem;
  color: var(--color-muted);
}

.external-task-project-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(7rem, 1fr));
  gap: 0.6rem;
  margin: 0;
}

.external-task-project-summary > div {
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.6rem;
  background: var(--color-surface);
}

.external-task-project-summary dt {
  color: var(--color-muted);
  font-size: 0.76rem;
  font-weight: 720;
}

.external-task-project-summary dd {
  margin: 0.18rem 0 0;
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 800;
}

.external-task-project-detail-table-scroll {
  min-width: 0;
}

.external-task-project-detail-table td {
  vertical-align: top;
}

.balance-details {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-top: 2px solid var(--color-accent);
}

.balance-details-header,
.balance-detail-section > header,
.balance-detail-section > header > div,
.balance-detail-summary,
.balance-detail-grid {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.balance-details-header,
.balance-detail-section > header {
  justify-content: space-between;
}

.balance-details-header h3,
.balance-detail-section h4 {
  margin: 0;
}

.balance-details-header p {
  margin: 0.2rem 0 0;
  color: var(--color-muted);
}

.balance-detail-section {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.balance-detail-section-financial { border-top: 3px solid var(--color-accent); }
.balance-detail-section-agent { border-top: 3px solid #9d78d2; }
.balance-detail-section-providers { border-top: 3px solid #5b9ed6; }
.balance-detail-section-direct-costs { border-top: 3px solid var(--color-muted); }

.balance-provider-receipt-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.7rem;
  padding: 0.72rem 0.8rem;
  border: 1px solid rgba(255, 160, 0, 0.78);
  border-radius: var(--radius);
  background: rgba(255, 160, 0, 0.12);
  animation: balance-provider-receipt-pulse 1.35s ease-in-out infinite;
}

.balance-provider-receipt-notice strong { color: var(--color-primary); }

.balance-provider-receipt-notice p {
  margin: 0.22rem 0 0;
  color: var(--color-text);
  font-size: 0.78rem;
}

.balance-provider-receipt-notice .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .balance-provider-receipt-alert,
  .balance-provider-payment-note-invoice-alert,
  .balance-provider-receipt-notice,
  .balance-provider-receipt-alert-count { animation: none; }
}

@media (max-width: 640px) {
  .balance-provider-receipt-alert-details {
    grid-template-columns: 1fr;
  }

  .balance-provider-receipt-alert-action {
    justify-self: stretch;
    text-align: center;
  }

  .balance-provider-receipt-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .balance-provider-receipt-notice .button { align-self: flex-start; }
}

.balance-detail-summary {
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--color-muted);
  font-size: 0.78rem;
}

.balance-detail-summary span {
  display: inline-flex;
  gap: 0.3rem;
  white-space: nowrap;
}

.balance-detail-summary strong { color: var(--color-text); }

.balance-detail-grid {
  align-items: stretch;
  flex-direction: column;
}

.balance-detail-grid > * {
  flex: 1 1 auto;
  width: 100%;
}

.balance-detail-table-scroll { margin-top: 0.7rem; }

.balance-detail-table {
  min-width: 580px;
  font-size: 0.76rem;
}

.balance-detail-table th,
.balance-detail-table td { padding: 0.45rem 0.5rem; }

.balance-provider-payment-list {
  display: grid;
  gap: .75rem;
  margin-top: .7rem;
}

.balance-provider-payment-card {
  display: grid;
  min-width: 0;
  gap: .8rem;
  padding: .85rem;
  border: 1px solid color-mix(in srgb, #5b9ed6 52%, var(--color-border));
  border-radius: calc(var(--radius) - 1px);
  background: var(--color-surface-elevated);
}

.balance-provider-payment-card-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: .7rem;
}

.balance-provider-payment-card-selector {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 2rem;
  color: var(--color-muted);
  font-size: .72rem;
  font-weight: 750;
  white-space: nowrap;
}

.balance-provider-payment-card-selector input {
  inline-size: 1rem;
  block-size: 1rem;
  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.balance-provider-payment-card-selector input:disabled { cursor: not-allowed; opacity: .48; }
.balance-provider-payment-card-heading { min-width: 0; }
.balance-provider-payment-card-heading h5 { margin: 0; color: var(--color-text); font-size: .96rem; overflow-wrap: anywhere; }
.balance-provider-payment-card-heading p { margin: .18rem 0 0; color: var(--color-muted); font-size: .78rem; line-height: 1.35; overflow-wrap: anywhere; }
.balance-provider-email-action { align-self: start; white-space: nowrap; }

.balance-provider-payment-card-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .62rem;
  margin: 0;
}

.balance-provider-payment-card-detail { min-width: 0; }
.balance-provider-payment-card-detail.is-wide { grid-column: span 2; }
.balance-provider-payment-card-detail dt { color: var(--color-muted); font-size: .68rem; font-weight: 750; text-transform: uppercase; }
.balance-provider-payment-card-detail dd { margin: .18rem 0 0; color: var(--color-text); font-size: .82rem; line-height: 1.4; overflow-wrap: anywhere; }
.balance-provider-payment-card-detail:not(.is-wide) dd { font-variant-numeric: tabular-nums; }
.balance-provider-payment-card .provider-payment-note-list { gap: .3rem; }
.balance-provider-payment-card .payment-note-invoice-download,
.balance-provider-payment-card .payment-note-invoice-register { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
body.theme-contrast .balance-provider-payment-card { border-width: 2px; border-color: var(--color-text); }

@media (max-width: 900px) {
  .balance-provider-payment-card-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .balance-provider-payment-card-detail.is-wide { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .balance-provider-payment-card { padding: .75rem; }
  .balance-provider-payment-card-header { grid-template-columns: minmax(0, 1fr) auto; }
  .balance-provider-payment-card-selector { grid-column: 1 / -1; min-height: auto; }
  .balance-provider-payment-card-details { grid-template-columns: minmax(0, 1fr); }
  .balance-provider-payment-card-detail.is-wide { grid-column: auto; }
}

/* Administração — comunicação mensal de férias, pontes e ausências. */
.monthly-absence-report-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: .75rem;
}

.monthly-absence-report-form .field { min-width: min(100%, 14rem); margin: 0; }
.monthly-absence-report-history-grid { display: grid; gap: .8rem; }
.monthly-absence-report-card {
  display: grid;
  gap: .8rem;
  min-width: 0;
  padding: .9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}
.monthly-absence-report-card > header { display: flex; align-items: start; justify-content: space-between; gap: .75rem; }
.monthly-absence-report-card h3 { margin: 0; font-size: .98rem; }
.monthly-absence-report-card header p { margin: .18rem 0 0; color: var(--color-muted); font-size: .78rem; }
.monthly-absence-report-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .62rem .8rem; margin: 0; }
.monthly-absence-report-card dl > div { min-width: 0; }
.monthly-absence-report-card dl > .is-wide { grid-column: span 3; }
.monthly-absence-report-card dt { color: var(--color-muted); font-size: .68rem; font-weight: 750; text-transform: uppercase; }
.monthly-absence-report-card dd { margin: .18rem 0 0; overflow-wrap: anywhere; color: var(--color-text); font-size: .82rem; line-height: 1.4; }
.monthly-absence-report-error dd { color: var(--color-danger); }
body.theme-contrast .monthly-absence-report-card { border-width: 2px; border-color: var(--color-text); }

@media (max-width: 760px) {
  .monthly-absence-report-card dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monthly-absence-report-card dl > .is-wide { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .monthly-absence-report-form { align-items: stretch; flex-direction: column; }
  .monthly-absence-report-form .button { width: 100%; }
  .monthly-absence-report-card { padding: .75rem; }
  .monthly-absence-report-card > header { align-items: stretch; flex-direction: column; }
  .monthly-absence-report-card .status-pill { align-self: flex-start; }
  .monthly-absence-report-card dl { grid-template-columns: minmax(0, 1fr); }
  .monthly-absence-report-card dl > .is-wide { grid-column: auto; }
}

/* Comissão no detalhe de Conta Corrente: o seletor reproduz a possibilidade
   legacy de reunir projetos de um único angariador numa nota. */
.balance-agent-payment-table {
  min-width: 62rem;
  table-layout: auto;
}

.balance-agent-payment-table .balance-agent-select-column {
  width: 4.4rem;
  min-width: 4.4rem;
  padding-right: 0.3rem;
  padding-left: 0.3rem;
  text-align: center;
  white-space: nowrap;
}

.balance-agent-payment-table .balance-agent-select-column input {
  display: inline-block;
  width: 1rem;
  min-width: 1rem;
  min-height: 1rem;
  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.balance-agent-payment-table .balance-agent-select-column input:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.balance-agent-unavailable { color: var(--color-muted); }

.quality-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.quality-toolbar h1 {
  margin: 0.08rem 0 0;
  font-size: 1.45rem;
}

.quality-toolbar p:not(.eyebrow) {
  margin: 0.2rem 0 0;
  color: var(--color-muted);
}

.quality-year-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.quality-year-picker .field {
  min-width: 110px;
}

.quality-year-picker select {
  min-height: 42px;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  font-weight: 800;
}

.quality-year-picker .icon-button,
.quality-chart-button,
.quality-dialog .icon-button {
  border-radius: 6px;
}

.quality-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quality-report-panel {
  padding: 0;
  overflow: hidden;
}

.quality-report-panel > .panel-header {
  align-items: center;
  padding: 1rem;
  margin: 0;
  border-bottom: 1px solid var(--color-border);
}

.quality-edit-hint {
  max-width: 17rem;
  color: var(--color-muted);
  font-size: 0.82rem;
  text-align: right;
}

.quality-table-scroll {
  overflow: auto;
  overscroll-behavior-inline: contain;
}

.quality-data-table {
  min-width: 1600px;
  table-layout: auto;
}

.quality-data-table th,
.quality-data-table td {
  padding: 0.6rem 0.55rem;
  font-size: 0.78rem;
}

.quality-data-table thead th {
  position: sticky;
  z-index: 2;
  top: 0;
  min-width: 68px;
  background: var(--color-surface-elevated);
  text-align: center;
}

.quality-data-table thead th:nth-child(-n + 4) {
  min-width: 145px;
  text-align: left;
}

.quality-data-table thead th:nth-child(2) {
  min-width: 265px;
}

.quality-indicator-name {
  width: 230px;
  min-width: 230px;
  color: var(--color-text) !important;
  font-size: 0.8rem !important;
  font-weight: 750;
  line-height: 1.25;
  text-transform: none !important;
}

.quality-calculation {
  width: 290px;
  min-width: 290px;
  color: var(--color-muted);
  line-height: 1.3;
}

.quality-target {
  width: 160px;
  min-width: 160px;
}

.quality-target > .quality-target-heading > [data-quality-target-text],
.quality-target > small {
  display: block;
}

.quality-target-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
}

.quality-target-edit {
  display: inline-grid;
  flex: 0 0 auto;
  width: 24px;
  min-width: 24px;
  max-width: 24px;
  height: 24px;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(244, 124, 32, 0.52);
  border-radius: 999px;
  color: var(--color-primary);
  background: rgba(244, 124, 32, 0.08);
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1;
  white-space: nowrap;
}

.quality-target-edit:hover,
.quality-target-edit:focus-visible {
  background: rgba(244, 124, 32, 0.2);
}

.quality-target small,
.quality-cell-detail {
  margin-top: 0.12rem;
  color: var(--color-muted);
  font-size: 0.68rem;
  line-height: 1.1;
}

.quality-value-cell,
.quality-annual-cell,
.quality-manual-cell {
  min-width: 74px;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: nowrap;
}

.quality-cell-main,
.quality-cell-detail {
  display: block;
}

.quality-value-cell.is-future {
  color: #74849a;
}

.quality-value-cell.is-future .quality-cell-main {
  font-size: 0;
}

.quality-value-cell.is-future .quality-cell-main::after {
  content: "—";
  font-size: 0.82rem;
}

.quality-annual-cell {
  min-width: 104px;
  border-left: 1px solid var(--color-border);
  font-weight: 800;
}

.quality-annual-cell.is-ok {
  background: rgba(59, 184, 120, 0.12);
  color: #bdf4d6;
}

.quality-annual-cell.is-attention {
  background: rgba(245, 185, 71, 0.13);
  color: #ffe2a0;
}

.quality-annual-cell.is-unavailable {
  color: #8593a4;
}

.quality-section-row th {
  padding: 0.5rem 0.8rem !important;
  border-top: 1px solid #40526a;
  border-bottom: 1px solid #40526a !important;
  background: rgba(83, 122, 155, 0.2);
  color: #c5d8e7 !important;
  font-size: 0.74rem !important;
  letter-spacing: 0.06em;
  text-align: left !important;
}

.quality-manual-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 32px;
  padding: 0.25rem 0.4rem;
  border: 1px dashed rgba(244, 124, 32, 0.56);
  border-radius: 0.45rem;
  color: var(--color-primary-strong);
  background: rgba(244, 124, 32, 0.07);
  cursor: pointer;
}

.quality-manual-button:hover {
  background: rgba(244, 124, 32, 0.16);
}

.quality-manual-pencil {
  color: var(--color-primary);
  font-size: 0.92rem;
}

.quality-manual-readonly {
  display: inline-block;
  min-width: 4rem;
}

.quality-chart-action {
  min-width: 54px;
  text-align: center !important;
  vertical-align: middle !important;
}

.quality-chart-button {
  color: #b9d5ea;
  background: rgba(83, 122, 155, 0.16);
  border-color: rgba(83, 122, 155, 0.52);
  font-size: 1.1rem;
}

.quality-chart-button:hover {
  color: #e4f3ff;
  background: rgba(83, 122, 155, 0.31);
}

.quality-dialog {
  width: min(620px, calc(100vw - 2rem));
  max-height: min(720px, calc(100vh - 2rem));
  padding: 1.25rem;
  border: 1px solid #3d536d;
  border-radius: 0.85rem;
  color: var(--color-text);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.quality-dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.quality-dialog h2 {
  margin: 0 2.5rem 1rem 0;
  font-size: 1.12rem;
}

.quality-dialog-close {
  float: right;
}

.quality-dialog-message {
  min-height: 1.35rem;
  margin: 0.7rem 0 0;
  color: var(--color-muted);
  font-size: 0.86rem;
}

.quality-target-form-grid {
  margin-bottom: 0.8rem;
}

.quality-chart-dialog {
  width: min(940px, calc(100vw - 2rem));
}

.quality-chart-graphic {
  min-height: 310px;
}

.quality-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.quality-chart-grid-line {
  stroke: rgba(169, 182, 198, 0.18);
  stroke-width: 1;
}

.quality-chart-axis {
  stroke: rgba(169, 182, 198, 0.56);
  stroke-width: 1;
}

.quality-chart-axis-label {
  fill: var(--color-muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
}

.quality-chart-bar {
  transition: filter 140ms ease, opacity 140ms ease;
}

.quality-chart-bar:hover {
  filter: brightness(1.2);
  opacity: 0.94;
}

.quality-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.quality-chart-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-muted);
  font-size: 0.78rem;
}

.quality-chart-legend span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.quality-chart-empty {
  margin: 0;
  padding: 2.5rem 1rem;
  color: var(--color-muted);
  text-align: center;
}

.table-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  width: min(100%, 620px);
}

.project-filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0 0 1rem;
  padding: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}

.select-search-input {
  width: 100%;
  min-width: 0;
}

.project-filter-picker {
  position: relative;
  align-content: start;
}

.project-customer-search,
.project-note-picker,
.project-product-search {
  position: relative;
}

.project-filter-picker:focus-within,
.project-customer-search:focus-within,
.project-note-picker:focus-within,
.project-product-search:focus-within {
  z-index: 20;
}

.project-filter-picker-results,
.project-customer-search-results,
.project-note-picker-results,
.project-product-search-results {
  display: grid;
  position: absolute;
  inset: calc(100% + 0.35rem) 0 auto;
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
  max-height: 15rem;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-soft);
}

.project-filter-picker-results[hidden] {
  display: none;
}

.project-filter-picker-result {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.project-filter-picker-result:last-child {
  border-bottom: 0;
}

.project-filter-picker-result:hover,
.project-filter-picker-result:focus-visible {
  color: var(--color-primary-strong);
  background: var(--color-surface-soft);
  outline: none;
}

.project-filter-details {
  margin: 0 0 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}

.project-filter-details > summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 0.9rem;
  cursor: pointer;
  color: var(--color-text);
  font-weight: 750;
  list-style: none;
}

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

.project-filter-details > summary::before {
  content: '›';
  color: var(--color-primary-strong);
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 0.16s ease;
}

.project-filter-details[open] > summary::before {
  transform: rotate(90deg);
}

.project-filter-details > summary small {
  margin-left: auto;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.project-filter-details[open] > summary small {
  font-size: 0;
}

.project-filter-details[open] > summary small::after {
  content: 'Fechar filtros';
  font-size: 0.78rem;
}

.project-filter-details .project-filter-form {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
}

.project-filter-heading {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.65rem;
}

.project-filter-heading strong {
  color: var(--color-text);
}

.project-filter-heading span {
  color: var(--color-muted);
  font-size: 0.82rem;
}

@media (max-width: 980px) {
  .project-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .project-filter-form {
    grid-template-columns: 1fr;
  }
}

.project-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem;
}

.project-data-table {
  min-width: 0;
}

.project-data-table .project-col-reference { width: 10%; }
.project-data-table .project-col-opn { width: 8%; }
.project-data-table .project-col-client-reference { width: 9%; }
.project-data-table .project-col-address { width: 16%; }
.project-data-table .project-col-city { width: 9%; }
.project-data-table .project-col-requester { width: 13%; }
.project-data-table .project-col-billing-customer { width: 13%; }
.project-data-table .project-col-date { width: 7%; }
.project-data-table .project-col-tasks-begin { width: 7%; }
.project-data-table .project-col-net-total { width: 11%; }
.project-data-table .project-col-status { width: 8%; }

.data-table.project-data-table th,
.data-table.project-data-table td {
  padding: 0.5rem 0.45rem;
  font-size: 0.82rem;
  line-height: 1.3;
}

.data-table.project-data-table th {
  font-size: 0.72rem;
  letter-spacing: 0.025em;
}

.project-content-row > td {
  vertical-align: middle;
}

/* A project occupies two consecutive table rows: its shortcuts and its
   fields. Give the whole pair one background, then alternate by project.
   The nth-child fallback keeps this visual grouping active even while an
   older cached PHP view is still serving rows without the block classes. */
.project-data-table .project-block-tone-a > td,
.project-data-table tbody > .project-actions-row:nth-child(4n + 1) > td,
.project-data-table tbody > .project-content-row:nth-child(4n + 2) > td {
  background: var(--color-surface-elevated);
}

.project-data-table .project-block-tone-b > td,
.project-data-table tbody > .project-actions-row:nth-child(4n + 3) > td,
.project-data-table tbody > .project-content-row:nth-child(4n + 4) > td {
  background: var(--color-surface-soft);
}

.project-content-row > td:first-child .project-list-cell {
  color: var(--color-primary-strong);
  font-weight: 800;
}

.project-list-cell {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.project-expand {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-primary-strong);
  background: var(--color-surface-soft);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
}

.project-expand:hover,
.project-expand:focus-visible {
  color: #111c2b;
  border-color: var(--color-primary-strong);
  background: var(--color-primary-strong);
}

.project-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
}

.project-actions-row > td {
  padding-block: 0.3rem;
  background: rgba(255, 255, 255, 0.025);
}

.project-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
}

.project-row-priority-actions,
.project-row-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.project-row-priority-actions {
  margin-right: auto;
}

.project-row-secondary-actions {
  margin-left: auto;
  justify-content: flex-end;
}

.project-actions-reference {
  min-width: 8rem;
  color: var(--color-primary-strong);
  overflow-wrap: anywhere;
}

.project-quick-actions a,
.project-action-disabled,
.project-quick-actions button,
.project-row-priority-actions a,
.project-row-priority-actions button,
.project-provider-action {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid #394b61;
  border-radius: 6px;
  background: var(--color-surface-soft);
  font-size: 0.78rem;
  line-height: 1;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.project-quick-actions form {
  display: contents;
  margin: 0;
}

.balance-moloni-draft-status {
  flex: 1 0 100%;
  margin-top: 0.12rem;
  color: var(--color-muted);
  font-size: 0.72rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.balance-moloni-draft-status.is-success {
  color: var(--color-success, #2f9f68);
}

.balance-moloni-draft-status.is-error {
  color: var(--color-danger, #e05461);
}

body.theme-contrast .balance-moloni-draft-status {
  color: var(--color-text);
  font-weight: 700;
}

/* Per-record automatic-email control. It stays compact in the action row
   and reveals the calculated date only when the user asks for it. */
.project-automatic-email-control {
  position: relative;
  display: inline-block;
}

.project-automatic-email-control > summary {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid #3d765e;
  border-radius: 6px;
  color: #8bd8a9;
  background: rgba(49, 126, 83, 0.14);
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}

.project-automatic-email-control > summary::-webkit-details-marker { display: none; }
.project-automatic-email-control > summary:hover,
.project-automatic-email-control > summary:focus-visible { border-color: #58b67c; color: #fff; background: #277449; outline: 0; }
.project-automatic-email-control.is-paused > summary { border-color: rgba(224, 84, 97, 0.76); color: #f3a7ae; background: rgba(224, 84, 97, 0.1); }
.project-automatic-email-control.is-global-inactive > summary,
.project-automatic-email-control.is-ineligible > summary,
.project-automatic-email-control.is-unavailable > summary,
.project-automatic-email-control.is-completed > summary,
.project-automatic-email-control.is-attention > summary { border-color: #53677e; color: var(--color-muted); background: rgba(83, 103, 126, 0.14); }

.project-automatic-email-popover {
  position: absolute;
  z-index: 12;
  top: calc(100% + 0.38rem);
  right: 0;
  display: grid;
  width: min(19rem, 78vw);
  gap: 0.42rem;
  padding: 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 0.55rem;
  color: var(--color-text);
  background: var(--color-surface-elevated);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34);
  font-size: 0.75rem;
  line-height: 1.35;
}

.project-automatic-email-popover strong { color: var(--color-text); }
.project-automatic-email-popover p { margin: 0; color: var(--color-muted); }
.project-automatic-email-popover small { color: var(--color-muted); }
.project-automatic-email-popover form { display: block; margin-top: 0.1rem; }
.project-automatic-email-popover .button { width: 100%; justify-content: center; }

.project-quick-actions-divider {
  width: 1px;
  height: 18px;
  margin-inline: 0.08rem;
  align-self: center;
  background: #394b61;
}

.project-quick-actions button {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.project-quick-actions a {
  font-size: 0.78rem;
}

/* The balance report reuses the project-list shortcut component. Its OPN
   shortcut is the one intentional exception: it needs room for its text
   label while retaining the same hover and focus animation. */
.project-quick-actions .balance-opn-action {
  width: auto;
  min-width: 2.6rem;
  padding-inline: 0.32rem;
  font-size: 0.64rem;
}

.project-provider-action {
  flex: 0 0 auto;
  margin-left: 0.15rem;
  color: var(--color-muted);
  text-decoration: none;
}

.project-provider-action.is-active {
  border-color: var(--color-primary);
  color: #fff;
  background: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(244, 124, 32, 0.2);
}

.project-provider-action:hover,
.project-provider-action:focus-visible {
  border-color: var(--color-primary-strong);
  color: #fff;
  background: var(--color-primary-strong);
  transform: translateY(-1px);
}

.project-quick-actions .project-expand {
  font-size: 1.05rem;
}

.project-quick-actions .project-action-delete {
  color: #e05461;
  border-color: rgba(224, 84, 97, 0.7);
  font-size: 1.1rem;
  font-weight: 800;
}

.project-quick-actions .project-action-delete:hover,
.project-quick-actions .project-action-delete:focus-visible {
  color: #fff;
  border-color: #ad2f3a;
  background: #ad2f3a;
}

.project-quick-actions a:hover,
.project-quick-actions a:focus-visible,
.project-quick-actions button:hover,
.project-quick-actions button:focus-visible,
.project-row-priority-actions a:hover,
.project-row-priority-actions a:focus-visible,
.project-row-priority-actions button:hover,
.project-row-priority-actions button:focus-visible {
  border-color: var(--color-primary-strong);
  color: #111c2b;
  background: var(--color-primary-strong);
  transform: translateY(-1px);
}

.project-action-disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.project-expanded-row > td {
  padding: 0;
  background: rgba(8, 17, 27, 0.48);
}

.project-expanded-content {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.project-expanded-summary,
.project-movement-history {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.project-expanded-summary > div,
.project-movement-history article {
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-elevated);
}

.project-expanded-summary span,
.project-movement-history small {
  color: var(--color-muted);
}

.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid #394b61;
  border-radius: var(--radius);
  padding: 0.35rem 0.6rem;
  color: var(--color-text);
  background: var(--color-surface-soft);
  font-weight: 700;
}

.table-action:hover {
  color: #111c2b;
  background: var(--color-primary-strong);
  border-color: var(--color-primary-strong);
}

.table-action-danger {
  color: #fff;
  background: #ad2f3a;
  border-color: #ad2f3a;
}

.table-action-danger:hover {
  color: #fff;
  background: #8d2530;
  border-color: #8d2530;
}

.estimate-line-action {
  width: 42px;
  text-align: center;
}

.project-create-estimate-table .estimate-col-action { width: 2%; }
.project-create-estimate-table .estimate-col-category { width: 3%; }
.project-create-estimate-table .estimate-col-designation { width: 24%; }
.project-create-estimate-table .estimate-col-quantity { width: 4%; }
.project-create-estimate-table .estimate-col-unit-price { width: 6%; }
.project-create-estimate-table .estimate-col-tax { width: 5%; }
.project-create-estimate-table .estimate-col-discount { width: 4%; }
.project-create-estimate-table .estimate-col-total { width: 5%; }
.project-create-estimate-table .estimate-col-project-manager { width: 7%; }
.project-create-estimate-table .estimate-col-designer { width: 6%; }
.project-create-estimate-table .estimate-col-fiscal { width: 5%; }
.project-create-estimate-table .estimate-col-inspection-manager { width: 7%; }
.project-create-estimate-table .estimate-col-duration-margin { width: 6%; }
.project-create-estimate-table .estimate-col-cost { width: 6%; }
.project-create-estimate-table .estimate-col-margin { width: 6%; }
.project-create-estimate-table .estimate-col-notes { width: 4%; }

.project-create-estimate-table .estimate-line-action {
  width: auto;
  padding-inline: 0.1rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.action-row form {
  margin: 0;
}

.action-panel {
  margin-bottom: 1rem;
}

.action-row-wide {
  gap: 0.6rem;
}

.split-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.module-roadmap .table-action {
  width: fit-content;
  margin-top: 0.25rem;
}

.record-form {
  display: grid;
  gap: 1rem;
}

/* Message composition prioritises the text itself, keeping the process
   context and technical options compact without changing the shared form. */
.project-note-form {
  width: 100%;
  gap: 0.85rem;
}

.project-note-form .form-section {
  padding: 1.1rem;
}

.project-note-form .form-section legend {
  color: var(--color-primary-strong);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-note-form .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.project-note-context-section {
  border-left: 4px solid var(--color-primary);
  background: linear-gradient(100deg, rgba(67, 117, 185, 0.13), var(--color-surface-elevated) 44%);
}

.project-note-context-section .project-note-field-pid { grid-column: span 2; order: 1; }
.project-note-context-section .project-note-field-idTask { grid-column: span 1; order: 2; }
.project-note-context-section .project-note-field-subject { order: 3; }
.project-note-context-section .project-note-field-date { order: 4; }
.project-note-context-section .project-note-field-uid { order: 5; }

.project-note-compose-section {
  border-color: rgba(112, 182, 255, 0.5);
  background: linear-gradient(145deg, rgba(69, 139, 217, 0.14), var(--color-surface-elevated) 42%);
  box-shadow: 0 0.8rem 2rem rgba(0, 0, 0, 0.12);
}

.project-note-compose-section .project-note-field-note {
  grid-column: 1 / -1;
}

.project-note-compose-section .project-note-field-note textarea {
  min-height: 7rem;
  padding: 0.9rem 1rem;
  border-color: rgba(112, 182, 255, 0.45);
  background: rgba(3, 16, 31, 0.45);
  font-size: 1rem;
  line-height: 1.55;
  resize: vertical;
}

.project-note-compose-section .project-note-field-note textarea:focus {
  border-color: #70b6ff;
  box-shadow: 0 0 0 3px rgba(112, 182, 255, 0.16);
}

.project-note-author {
  display: flex;
  align-items: center;
  min-height: 2.7rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background: var(--color-surface-soft);
  color: var(--color-text);
  font-weight: 700;
}

.project-note-form input[type="file"] {
  width: fit-content;
  max-width: 100%;
  margin-top: 0.5rem;
  color: var(--color-muted);
  font-size: 0.83rem;
}

.project-note-form [data-note-image-status] {
  display: block;
  margin-top: 0.25rem;
}

.project-note-form .form-actions {
  position: sticky;
  bottom: 0.75rem;
  z-index: 5;
  width: fit-content;
  margin-top: 0.15rem;
  padding: 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) + 0.15rem);
  background: color-mix(in srgb, var(--color-surface-elevated) 92%, transparent);
  box-shadow: 0 0.7rem 1.6rem rgba(0, 0, 0, 0.22);
}

@media (max-width: 860px) {
  .project-note-form .form-grid { grid-template-columns: 1fr; }
  .project-note-context-section .project-note-field-pid,
  .project-note-context-section .project-note-field-idTask { grid-column: auto; }
  .project-note-form .form-actions { width: 100%; bottom: 0.35rem; }
  .project-note-form .form-actions .button { flex: 1 1 auto; }
}

.upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}

.form-section {
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--color-surface-elevated);
}

.form-section legend {
  padding: 0 0.35rem;
  color: var(--color-text);
  font-weight: 800;
}

.project-creation-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  color: var(--color-text);
  font-weight: 800;
  list-style: none;
}

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

.project-creation-section > summary::before {
  content: "+";
  margin-right: 0.45rem;
  color: var(--color-primary);
}

.project-creation-section[open] > summary::before {
  content: "−";
}

.project-creation-section > summary small {
  margin-left: auto;
  color: var(--color-muted);
  font-weight: 700;
}

.project-creation-section.is-complete > summary small {
  color: #bcf1d3;
}

.project-creation-section > .form-grid,
.project-creation-section > .detail-note,
.project-creation-section > .field,
.project-creation-section > .member-picker-list {
  margin-top: 0.9rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.project-creation-form .form-grid {
  grid-template-columns: minmax(0, 1fr);
  max-width: none;
}

.project-creation-form .field-textarea,
.project-creation-form .project-creation-wide {
  grid-column: auto;
}

.project-customer-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem 0.8rem;
}

.project-customer-actions .field-help {
  margin: 0;
}

.project-customer-search {
  display: grid;
  gap: 0.45rem;
}

.project-customer-search-results[hidden] {
  display: none;
}

.project-customer-search-result {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.project-customer-search-result:last-child {
  border-bottom: 0;
}

.project-customer-search-result:hover,
.project-customer-search-result:focus-visible {
  color: var(--color-primary-strong);
  background: var(--color-surface-soft);
  outline: none;
}

.project-note-picker {
  display: grid;
  gap: 0.45rem;
}

.project-note-picker-results[hidden] {
  display: none;
}

.project-note-picker-result {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.project-note-picker-result:last-child {
  border-bottom: 0;
}

.project-note-picker-result:hover,
.project-note-picker-result:focus-visible {
  color: var(--color-primary-strong);
  background: var(--color-surface-soft);
  outline: none;
}

.project-new-customer {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
  border-radius: var(--radius);
  background: var(--color-surface-soft);
}

.project-new-customer[hidden],
[data-project-billing-customer][hidden],
[data-project-billing-field][hidden] {
  display: none;
}

.project-new-customer-header {
  display: grid;
  gap: 0.2rem;
}

.project-new-customer-header h4,
.project-new-customer-header p {
  margin: 0;
}

.project-new-customer-header p {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.project-new-customer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.project-new-customer-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 0.8rem;
}

.project-new-customer-actions .project-customer-editor-status {
  margin: 0;
}

.project-billing-different {
  align-items: flex-start;
  padding: 0.2rem 0;
}

.project-billing-customer {
  grid-column: 1 / -1;
  padding: 0.75rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
  border-radius: var(--radius);
  background: var(--color-surface-soft);
}

.project-billing-customer-change-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem 0.8rem;
  align-items: end;
  margin-top: 0.85rem;
  padding: 0.8rem;
  border: 1px solid color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}

.project-billing-customer-change-form label {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  color: var(--color-text);
  font-size: 0.84rem;
  font-weight: 800;
}

.project-billing-customer-change-form label > span {
  color: var(--color-muted);
}

.project-billing-customer-change-form p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--color-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.project-billing-customer-change-status {
  margin: -0.15rem 0 0;
  font-size: 0.84rem;
  font-weight: 700;
}

.project-billing-customer-change-status.is-success {
  color: #bcf1d3;
}

.project-billing-customer-change-status.is-error {
  color: #ffd3d3;
}

@media (max-width: 640px) {
  .project-billing-customer-change-form {
    grid-template-columns: 1fr;
  }

  .project-billing-customer-change-form button {
    justify-self: start;
  }
}

.project-billing-help {
  margin: -0.35rem 0 0;
}

.project-customer-columns {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.project-customer-side {
  display: grid;
  align-content: start;
  gap: 0.8rem;
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
  border-radius: var(--radius);
  background: var(--color-surface-soft);
}

.project-customer-editor[hidden] {
  display: none;
}

.project-customer-side-header {
  display: grid;
  gap: 0.2rem;
}

.project-customer-side-header h3,
.project-customer-side-header p {
  margin: 0;
}

.project-customer-side-header p {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.project-customer-editor {
  display: grid;
  align-content: start;
  gap: 0.8rem;
  padding: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
  border-radius: var(--radius);
  background: var(--color-surface-soft);
}

.project-customer-editor-header {
  display: grid;
  gap: 0.2rem;
}

.project-customer-editor-header h4,
.project-customer-editor-header p,
.project-customer-editor-status {
  margin: 0;
}

.project-customer-editor-header p,
.project-customer-editor-status {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.project-customer-editor-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.project-customer-editor-fields .project-customer-editor-wide {
  grid-column: 1 / -1;
}

.project-customer-editor-status.is-success {
  color: var(--color-primary-strong);
}

.project-customer-editor-status.is-error {
  color: var(--color-danger, #b42318);
}

.field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.field-textarea {
  grid-column: span 2;
}

.project-creation-wide {
  grid-column: span 2;
}

.project-create-product-lines {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.project-create-products-bottom {
  display: grid;
  gap: 0.8rem;
}

.project-product-search-header {
  display: grid;
  gap: 0.25rem;
}

.project-product-search-header h3,
.project-product-search-header p {
  margin: 0;
}

.project-product-search-header p {
  color: var(--color-muted);
}

.project-product-search {
  position: relative;
}

.project-product-search-results {
  max-height: 17rem;
}

.project-product-search-results[hidden] {
  display: none;
}

.project-product-selected-categories {
  display: grid;
  gap: 0.45rem;
}

.project-product-selected-categories[hidden] {
  display: none;
}

.project-product-selected-category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.project-product-selected-category {
  border: 1px solid var(--color-primary);
  border-radius: 999px;
  padding: 0.42rem 0.7rem;
  color: var(--color-primary-strong);
  background: var(--color-surface-soft);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.project-product-selected-category:hover,
.project-product-selected-category:focus-visible {
  color: var(--color-text);
  background: var(--color-primary);
  outline: none;
}

.project-product-search-result {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.project-product-search-result:last-child {
  border-bottom: 0;
}

.project-product-search-result:hover,
.project-product-search-result:focus-visible {
  color: var(--color-primary-strong);
  background: var(--color-surface-soft);
  outline: none;
}

.project-product-search-result.is-selected,
.project-product-search-result:disabled {
  color: var(--color-muted);
  background: var(--color-surface-soft);
  cursor: default;
  opacity: 0.75;
}

.project-detail-category-picker {
  margin: 0 0 1rem;
}

.project-detail-category-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.project-detail-category-status {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.88rem;
}

.project-detail-category-status.is-success {
  color: #bcf1d3;
}

.project-detail-category-status.is-error {
  color: #ffd3d3;
}

.average-cost-time-distribution {
  display: grid;
  gap: 0.8rem;
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
}

.average-cost-time-distribution h3,
.average-cost-time-distribution p {
  margin: 0;
}

.average-cost-time-distribution > div {
  display: grid;
  gap: 0.25rem;
}

.average-cost-time-distribution > div p,
.average-cost-time-distribution-readonly {
  color: var(--color-muted);
}

.average-cost-time-distribution-form {
  display: grid;
  grid-template-columns: minmax(10rem, 15rem) minmax(10rem, 15rem) auto auto;
  align-items: end;
  gap: 0.7rem;
}

.average-cost-time-distribution-form .field {
  gap: 0.3rem;
}

.average-cost-time-distribution-total {
  padding-bottom: 0.65rem;
  white-space: nowrap;
}

.average-cost-time-distribution-total strong {
  color: var(--color-primary-strong);
}

.average-cost-time-distribution-status,
.average-cost-time-distribution-warning {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.average-cost-time-distribution-warning,
.average-cost-time-distribution-status.is-error {
  color: #ffd3d3;
}

.average-cost-time-distribution-status.is-success {
  color: #bcf1d3;
}

.personnel-cost-summary {
  display: grid;
  gap: 0.85rem;
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
}

.personnel-cost-summary .panel-header,
.personnel-cost-summary .panel-header h3,
.personnel-cost-summary .panel-header p,
.personnel-cost-summary-formula {
  margin: 0;
}

.personnel-cost-summary .panel-header p,
.personnel-cost-summary-formula {
  color: var(--color-muted);
}

.personnel-cost-summary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(9rem, 1fr));
  gap: 0.65rem;
}

.personnel-cost-summary-metrics span {
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 0.8);
  color: var(--color-muted);
  font-size: 0.82rem;
  background: var(--color-surface);
}

.personnel-cost-summary-metrics strong {
  color: var(--color-text);
  font-size: 1.15rem;
}

.personnel-cost-summary-table td {
  white-space: nowrap;
}

.personnel-cost-summary-table td:last-child strong {
  color: var(--color-primary-strong);
}

.personnel-cost-summary-formula {
  font-size: 0.88rem;
}

.personnel-cost-indicator {
  display: grid;
  grid-column: 1 / -1;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
}

.personnel-cost-indicator > span,
.personnel-cost-indicator small {
  color: var(--color-muted);
}

.personnel-cost-indicator strong {
  color: var(--color-primary-strong);
  font-size: 1.35rem;
}

.temporary-access-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.65rem max(1rem, calc((100vw - 1400px) / 2));
  color: #1f1600;
  background: #f9d76b;
  border-bottom: 1px solid #c79b18;
  box-shadow: 0 5px 14px rgba(40, 28, 0, 0.18);
}

.temporary-access-banner p {
  margin: 0;
}

.temporary-access-banner span {
  margin-right: auto;
  font-size: 0.82rem;
}

.temporary-access-banner form {
  margin: 0;
}

.temporary-access-banner .button {
  white-space: nowrap;
}

.temporary-access-panel {
  margin-top: 1rem;
}

.temporary-access-form {
  display: flex;
  align-items: end;
  gap: 0.8rem;
}

.temporary-access-form .field {
  flex: 1 1 320px;
  margin: 0;
}

.temporary-access-form .button {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .temporary-access-banner,
  .temporary-access-form {
    align-items: stretch;
    flex-direction: column;
  }

  .temporary-access-banner span {
    margin-right: 0;
  }
}

.learning-period-indicator {
  border-color: var(--color-accent);
}

.detail-field-learning-period {
  grid-column: 1 / -1;
  border-left: 3px solid var(--color-warning, #d99222);
}

.detail-field-learning-period small {
  display: block;
  margin-top: 0.28rem;
  color: var(--color-muted);
}

.dashboard-learning-periods-panel {
  margin-top: 1rem;
  border-top: 3px solid var(--color-accent);
}

.dashboard-learning-period-item strong {
  color: var(--color-primary-strong);
}

.dashboard-personal-learning-period {
  margin-top: 1rem;
  border-top: 3px solid var(--color-warning, #d99222);
}

.dashboard-personal-learning-period-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-personal-learning-period h2 {
  margin: 0;
  font-size: 1.08rem;
}

.dashboard-personal-learning-period-status,
.dashboard-personal-learning-period-dates,
.dashboard-personal-learning-period-note {
  margin: 0.35rem 0 0;
}

.dashboard-personal-learning-period-status strong {
  color: var(--color-primary-strong);
}

.dashboard-personal-learning-period-dates,
.dashboard-personal-learning-period-note {
  color: var(--color-muted);
}

.dashboard-personal-learning-period-note {
  padding-top: 0.6rem;
  border-top: 1px solid var(--color-border);
}

@media (max-width: 760px) {
  .average-cost-time-distribution-form {
    grid-template-columns: 1fr;
  }

  .average-cost-time-distribution-total {
    padding-bottom: 0;
  }

  .personnel-cost-summary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Cálculo BT V2: isolated, read-only preview of the client's new workflow. */
.bt-v2-page { --bt-v2-accent: var(--color-primary); }
.bt-v2-hero { border-bottom: 1px solid var(--color-border); padding-bottom: 1rem; }
.bt-v2-scope-notice { display: flex; gap: .8rem; border-color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 12%, var(--color-surface)); color: var(--color-text); }
.bt-v2-scope-notice p { margin: .25rem 0 0; color: var(--color-muted); }

/* Continuous Improvement is a read-only analysis workspace. Keep its tabs
   compact so the existing administration navigation remains the primary
   navigation on smaller screens. */
.improvement-tabs { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1rem; }
.improvement-tabs a { border: 1px solid var(--color-border); border-radius: 999px; color: var(--color-muted); padding: .42rem .72rem; text-decoration: none; }
.improvement-tabs a:hover, .improvement-tabs a:focus-visible, .improvement-tabs a.is-active { border-color: var(--color-primary); color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface)); }
.improvement-section { margin-top: 1rem; }
.improvement-formula { margin: .65rem 0; color: var(--color-text); }
.improvement-data-table { min-width: 0; font-size: .78rem; }
.improvement-data-table th, .improvement-data-table td { padding: .6rem .48rem; white-space: normal; }
.improvement-data-table .table-sort { align-items: flex-start; min-width: 0; }

@media (max-width: 720px) {
  .improvement-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; }
  .improvement-tabs a { flex: 0 0 auto; }
  .improvement-metric-grid, .improvement-time-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.bt-v2-form { padding: 1rem; }
.bt-v2-workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(21rem, 31rem); align-items: start; gap: 1rem; }
.bt-v2-form fieldset { background: color-mix(in srgb, var(--color-surface-elevated) 72%, transparent); border-color: var(--color-border); }
.bt-v2-form .field-help { color: var(--color-muted); }
.bt-v2-form [data-bt-v2-condition] { animation: bt-v2-field-enter .16s ease-out; }
.bt-v2-form [data-bt-v2-condition][hidden] { display: none !important; }
.bt-v2-form .is-required::first-line { font-weight: 750; }
.bt-v2-form .is-required::after { content: ' *'; color: var(--color-danger); font-weight: 900; }
.bt-v2-form label.electrical-checkbox.is-required::after { content: ''; }
.bt-v2-choice-intro { margin: 0 0 .8rem; padding: .65rem .75rem; border-left: 3px solid var(--bt-v2-accent); border-radius: 0 .5rem .5rem 0; color: var(--color-muted); background: color-mix(in srgb, var(--color-primary) 7%, var(--color-surface)); font-size: .82rem; line-height: 1.45; }
.bt-v2-advanced { margin-top: .75rem; border: 1px solid var(--color-border); border-radius: .6rem; background: var(--color-surface); }
.bt-v2-advanced > summary { padding: .72rem .8rem; color: var(--color-text); cursor: pointer; font-weight: 800; }
.bt-v2-advanced[open] > summary { border-bottom: 1px solid var(--color-border); }
.bt-v2-advanced > div { padding: .8rem; }
@keyframes bt-v2-field-enter { from { opacity: .35; transform: translateY(-.18rem); } to { opacity: 1; transform: translateY(0); } }
.bt-v2-field-error { display: block; color: var(--color-danger); font-size: .72rem; font-weight: 800; line-height: 1.35; }
.bt-v2-method-grid { display: grid; grid-template-columns: repeat(7, minmax(125px, 1fr)); gap: .65rem; margin-bottom: 1rem; }
.bt-v2-method-card { position: relative; display: grid !important; grid-template-columns: 2rem minmax(0, 1fr); align-items: center; gap: .55rem !important; min-height: 5.2rem; padding: .7rem; border: 1px solid var(--color-border); border-radius: .65rem; background: var(--color-surface); color: var(--color-text); cursor: pointer; }
.bt-v2-method-card:hover { border-color: var(--bt-v2-accent); background: var(--color-primary-soft); }
.bt-v2-method-card:has(input:focus-visible) { outline: 3px solid var(--color-primary-strong); outline-offset: 2px; }
.bt-v2-method-card:has(input:checked) { border-color: var(--bt-v2-accent); box-shadow: inset 0 0 0 1px var(--bt-v2-accent); background: var(--color-primary-soft); }
.bt-v2-method-card input { position: absolute; inline-size: 1px !important; block-size: 1px; opacity: 0; }
.bt-v2-method-card svg { inline-size: 2rem; block-size: 2rem; color: var(--bt-v2-accent); }
.bt-v2-method-card span, .bt-v2-method-card strong, .bt-v2-method-card small { display: block; min-width: 0; }
.bt-v2-method-card strong { font-size: .78rem; }
.bt-v2-method-card small { margin-top: .16rem; color: var(--color-muted); font-size: .67rem; font-weight: 500; line-height: 1.25; }
.bt-v2-factor-fields { margin-top: .4rem; }
.bt-v2-submit-copy { display: flex; flex-direction: column; justify-content: center; gap: .15rem; min-height: 2.75rem; color: var(--color-muted); font-size: .78rem; }
.bt-v2-submit-copy strong { color: var(--color-text); }
.bt-v2-form-actions { display: flex; align-items: center; gap: 1rem; }
.bt-v2-form-actions span { color: var(--color-muted); font-size: .8rem; }
.bt-v2-results { position: sticky; top: .75rem; max-height: calc(100vh - 1.5rem); padding: 1rem; overflow: auto; scroll-margin-top: 1rem; }
.bt-v2-result-heading .eyebrow, .bt-v2-proposal .eyebrow { color: var(--bt-v2-accent); font-size: .69rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.bt-v2-validation-summary { margin: 0 0 1rem; padding: .8rem 1rem; border-left: 4px solid var(--color-danger); border-radius: .45rem; background: color-mix(in srgb, var(--color-danger) 12%, var(--color-surface)); }
.bt-v2-validation-summary ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.bt-v2-inline-warning { margin-bottom: .65rem; }
.bt-v2-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0; }
.bt-v2-kpi-grid article { display: grid; gap: .25rem; min-width: 0; padding: .85rem; border: 1px solid var(--color-border); border-radius: .55rem; background: var(--color-surface-elevated); }
.bt-v2-kpi-grid span { color: var(--color-muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.bt-v2-kpi-grid strong { overflow-wrap: anywhere; font-size: 1.25rem; }
.bt-v2-kpi-grid small { color: var(--color-muted); }
.bt-v2-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.bt-v2-result-card { min-width: 0; padding: 1rem; border: 1px solid var(--color-border); border-radius: .6rem; background: var(--color-surface); }
.bt-v2-result-card h3 { margin-top: 0; }
.bt-v2-result-card dl, .bt-v2-trace dl { display: grid; gap: .4rem; margin: 0; }
.bt-v2-result-card dl > div, .bt-v2-trace dl > div { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .35rem; border-bottom: 1px dashed var(--color-border); }
.bt-v2-result-card dt, .bt-v2-trace dt { color: var(--color-muted); }
.bt-v2-result-card dd, .bt-v2-trace dd { margin: 0; font-weight: 800; text-align: right; overflow-wrap: anywhere; }
.bt-v2-result-card details, .bt-v2-trace { margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--color-border); }
.bt-v2-result-card summary, .bt-v2-trace summary { color: var(--bt-v2-accent); font-weight: 800; cursor: pointer; }
.bt-v2-result-card details p { color: var(--color-muted); font-size: .78rem; }
.bt-v2-proposal { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1rem 0; padding: 1rem; border: 1px solid var(--color-success); border-radius: .65rem; background: color-mix(in srgb, var(--color-success) 10%, var(--color-surface)); }
.bt-v2-proposal.is-empty { border-color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 9%, var(--color-surface)); }
.bt-v2-proposal h3 { margin: .2rem 0; }
.bt-v2-proposal p { margin: 0; color: var(--color-muted); }
.bt-v2-protection-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem .8rem; margin: .8rem 0 0; font-size: .74rem; }
.bt-v2-protection-meta div { display: grid; gap: .1rem; min-width: 0; }
.bt-v2-protection-meta dt { color: var(--color-muted); }
.bt-v2-protection-meta dd { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.bt-v2-checks { display: grid; gap: .35rem; min-width: min(100%, 23rem); font-size: .78rem; }
.bt-v2-checks span { padding: .5rem .65rem; border-radius: .4rem; background: var(--color-surface-elevated); }
.bt-v2-criteria { display: grid; gap: .55rem; margin: 1rem 0; }
.bt-v2-criteria h3 { margin-bottom: .15rem; }
.bt-v2-criteria .electrical-criterion { background: var(--color-surface-soft); }
.bt-v2-final-warning { display: grid; gap: .25rem; background: color-mix(in srgb, var(--color-warning) 12%, var(--color-surface)); color: var(--color-text); }
.bt-v2-final-warning span { color: var(--color-muted); }
.bt-v2-empty-result { min-height: 9rem; }
body.theme-contrast .bt-v2-method-card,
body.theme-contrast .bt-v2-kpi-grid article,
body.theme-contrast .bt-v2-result-card,
body.theme-contrast .bt-v2-proposal { border-width: 2px; }
@media (max-width: 1450px) {
    .bt-v2-method-grid { grid-template-columns: repeat(4, minmax(135px, 1fr)); }
}
@media (max-width: 950px) {
    .bt-v2-method-grid, .bt-v2-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bt-v2-result-grid { grid-template-columns: minmax(0, 1fr); }
    .bt-v2-proposal { align-items: flex-start; flex-direction: column; }
    .bt-v2-workspace-grid { grid-template-columns: minmax(0, 1fr); }
    .bt-v2-results { position: static; max-height: none; }
}
@media (max-width: 560px) {
    .bt-v2-method-grid, .bt-v2-kpi-grid { grid-template-columns: minmax(0, 1fr); }
    .bt-v2-form-actions { align-items: flex-start; flex-direction: column; }
    .bt-v2-protection-meta { grid-template-columns: minmax(0, 1fr); }
}

/* Internal chat --------------------------------------------------------- */
.chat-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.chat-channel-panel, .chat-start-panel, .chat-message-panel { min-width: 0; }
.chat-channel-panel { position: sticky; top: 1rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 0.65rem; overflow: hidden; }
.chat-panel-heading { padding: 1rem; margin: 0; border-bottom: 1px solid var(--color-border); }
.chat-panel-heading h2, .chat-welcome h2, .chat-create-card h3, .chat-project-note h3, .chat-conversation-header h2, .chat-members-panel h3, .chat-checklist h3, .chat-delete-panel h2 { margin: 0; }
.chat-panel-heading p:last-child, .chat-welcome > p:not(.eyebrow), .chat-create-card > p, .chat-project-note p { color: var(--color-muted); }
.chat-channel-list { display: grid; max-height: calc(100vh - 15rem); overflow: auto; }
.chat-channel-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; padding: .7rem; border-bottom: 1px solid var(--color-border); }
.chat-channel-search input { min-width: 0; }
.chat-channel-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .65rem; align-items: center; padding: .8rem .85rem; color: var(--color-text); border-bottom: 1px solid var(--color-border); text-decoration: none; }
.chat-channel-row:hover, .chat-channel-row:focus-visible { background: color-mix(in srgb, var(--color-primary) 8%, transparent); }
.chat-channel-row.is-unread { background: color-mix(in srgb, var(--color-primary) 12%, transparent); }
.chat-channel-main { display: grid; gap: .16rem; min-width: 0; }
.chat-channel-main strong, .chat-channel-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-channel-main small { color: var(--color-muted); font-size: .75rem; }
.chat-channel-icon { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; font-style: normal; color: var(--color-primary-strong); background: color-mix(in srgb, var(--color-primary) 12%, transparent); border-radius: .32rem; }
.chat-unread-badge, .chat-header-unread { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding: 0 .25rem; border-radius: 99px; color: #fff; background: var(--color-danger); font-size: .68rem; font-weight: 800; }
.chat-start-panel { display: grid; gap: 1rem; }
.chat-welcome { padding: 1.25rem; }
.chat-legend { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; color: var(--color-muted); font-size: .84rem; }
.chat-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.chat-create-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.chat-create-card, .chat-project-note { padding: 1.1rem; }
.chat-create-card form { display: grid; gap: .75rem; margin-top: 1rem; }
.chat-create-card .button { justify-self: start; }
.chat-project-note { border-left: 4px solid var(--color-primary); }
.chat-conversation { display: grid; gap: 1rem; }
.chat-conversation-header { padding: 1rem 1.2rem; }
.chat-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.chat-title-row p { margin: .24rem 0 0; color: var(--color-muted); }
.chat-title-row p a, .back-link { color: var(--color-primary-strong); }
.back-link { display: inline-block; margin-bottom: .6rem; font-size: .82rem; font-weight: 700; text-decoration: none; }
.chat-header-actions { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: flex-end; }
.chat-header-actions form { margin: 0; }
.chat-conversation-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 290px); gap: 1rem; align-items: start; }
.chat-message-panel { display: grid; gap: 1rem; }
.chat-message-list { display: grid; gap: .8rem; }
.chat-message { padding: .9rem 1rem; border: 1px solid var(--color-border); border-left: 4px solid var(--color-primary); border-radius: .5rem; background: var(--color-surface); }
.chat-message > header { display: flex; gap: .6rem; align-items: center; }
.chat-message { position: relative; }
.chat-message.is-own { border-left-width: 1px; border-right: 4px solid var(--color-primary); }
.chat-message.is-own > header { flex-direction: row-reverse; justify-content: flex-start; text-align: right; }
.chat-message.is-own > header div { justify-items: end; }
.chat-message.is-own .chat-message-actions { right: auto; left: .7rem; }
.chat-message.is-own .chat-message-text { text-align: right; }
.chat-message-actions { position: absolute; top: .65rem; right: .7rem; display: flex; gap: .25rem; }
.chat-message-actions form { margin: 0; }
.chat-message > header div { display: grid; gap: .08rem; }
.chat-message > header small { color: var(--color-muted); font-size: .73rem; }
.chat-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 2rem; height: 2rem; border: 1px solid transparent; border-radius: 50%; color: #fff; background: var(--color-primary-strong); font-size: .7rem; font-weight: 800; }
.chat-avatar-photo { display: block; object-fit: cover; background: var(--color-surface-elevated); }
.chat-message-text { margin: .75rem 0 0; overflow-wrap: anywhere; line-height: 1.5; }
.chat-mentions { display: inline-flex; margin-top: .65rem; padding: .25rem .45rem; border-radius: .3rem; color: var(--color-primary-strong); background: color-mix(in srgb, var(--color-primary) 10%, transparent); font-size: .74rem; font-weight: 700; }
.chat-mentions.is-mentioned { color: #5d2600; background: #ffe0c4; }
.chat-checklist { margin-top: .8rem; padding: .75rem; background: color-mix(in srgb, var(--color-primary) 7%, transparent); border: 1px solid color-mix(in srgb, var(--color-primary) 25%, var(--color-border)); border-radius: .38rem; }
.chat-checklist h3 { color: var(--color-primary-strong); font-size: .86rem; }
.chat-checklist ul { display: grid; gap: .45rem; padding: 0; margin: .65rem 0 0; list-style: none; }
.chat-checklist li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45rem; align-items: center; }
.chat-checklist li small { grid-column: 2; color: var(--color-muted); font-size: .7rem; }
.chat-checklist li.is-done > span { color: var(--color-muted); text-decoration: line-through; }
.chat-check-button { display: grid; place-items: center; width: 1.25rem; height: 1.25rem; padding: 0; color: #fff; background: transparent; border: 1px solid var(--color-primary-strong); border-radius: .25rem; cursor: pointer; }
.chat-checklist li.is-done .chat-check-button { background: var(--color-success); border-color: var(--color-success); }
.chat-attachments { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .8rem; }
.chat-attachment { display: grid; gap: .3rem; max-width: 13rem; padding: .45rem; color: var(--color-primary-strong); background: color-mix(in srgb, var(--color-primary) 7%, transparent); border: 1px solid var(--color-border); border-radius: .35rem; text-decoration: none; overflow-wrap: anywhere; font-size: .76rem; }
.chat-attachment.is-image { max-width: 15rem; }
.chat-attachment img { width: 100%; max-height: 11rem; object-fit: cover; border-radius: .2rem; }
.chat-compose { display: grid; gap: .8rem; padding: 1rem; }
.chat-compose textarea { min-height: 6rem; resize: vertical; }
.chat-attachment-draft { display: grid; gap: .45rem; margin-top: .65rem; padding: .65rem; border: 1px solid var(--color-border); border-radius: .4rem; background: var(--color-surface-elevated); }
.chat-attachment-draft[hidden] { display: none !important; }
.chat-attachment-draft-list { display: grid; gap: .35rem; }
.chat-attachment-draft-item { display: flex; gap: .5rem; align-items: center; justify-content: space-between; min-width: 0; }
.chat-attachment-draft-item > span { min-width: 0; overflow-wrap: anywhere; }
.chat-attachment-draft-item .button { flex: 0 0 auto; padding: .26rem .5rem; font-size: .75rem; }
.task-template-insert { display: grid; gap: .85rem; margin: 1rem 0; }
.task-template-insert form { display: grid; gap: .75rem; }
.task-template-choices { display: grid; gap: .6rem; }
.task-template-choices[hidden] { display: none !important; }
.task-template-choice-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .45rem .8rem; }
.task-template-choice { display: flex; gap: .45rem; align-items: flex-start; min-width: 0; padding: .5rem .6rem; border: 1px solid var(--color-border); border-radius: .35rem; background: var(--color-surface-elevated); }
.task-template-choice[hidden] { display: none !important; }
.task-template-choice span { overflow-wrap: anywhere; }
.task-template-choice.is-existing { opacity: .68; }
.chat-checklist-builder { border: 1px solid var(--color-border); border-radius: .4rem; }
.chat-checklist-builder > summary { padding: .6rem .75rem; cursor: pointer; color: var(--color-primary-strong); font-weight: 700; }
.chat-checklist-builder > div { display: grid; gap: .65rem; padding: .75rem; border-top: 1px solid var(--color-border); }
.chat-compose-actions { display: flex; justify-content: flex-end; }
.chat-pinned-panel { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .8rem; align-items: start; padding: .8rem 1rem; }
.chat-pinned-panel h3 { margin: 0; color: var(--color-primary-strong); font-size: .84rem; }
.chat-pinned-panel > div { display: flex; flex-wrap: wrap; gap: .45rem; }
.chat-pinned-panel a { max-width: 24rem; padding: .28rem .45rem; overflow: hidden; color: var(--color-text); background: color-mix(in srgb, var(--color-primary) 7%, transparent); border-radius: .3rem; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; }
.chat-members-panel { display: grid; gap: 1rem; position: sticky; top: 1rem; }
.chat-members-panel .panel { padding: 1rem; }
.chat-member-list { display: grid; gap: .55rem; padding: 0; margin: .8rem 0 0; list-style: none; }
.chat-member-list li { display: flex; align-items: center; gap: .45rem; font-size: .82rem; }
.chat-member-list .chat-avatar { width: 1.55rem; height: 1.55rem; font-size: .57rem; }
.chat-member-list form { margin-left: auto; }
.chat-add-members form { display: grid; gap: .65rem; margin-top: .8rem; }
.chat-empty-state { padding: 2rem; text-align: center; }
body.theme-contrast .chat-avatar { border: 2px solid var(--color-text); }
.chat-delete-panel { max-width: 48rem; padding: 1.35rem; }
.chat-delete-panel > p:not(.eyebrow) { max-width: 42rem; color: var(--color-muted); line-height: 1.55; }
.chat-delete-steps { display: grid; gap: 1rem; padding: 0; margin: 1.15rem 0; list-style-position: inside; }
.chat-delete-steps li { display: grid; gap: .45rem; padding: .85rem; border: 1px solid var(--color-border); border-radius: .45rem; }
.chat-delete-steps li.is-ready { color: var(--color-success); border-color: var(--color-success); }
.chat-delete-steps small { color: var(--color-muted); }
.checkbox-field { display: flex; align-items: flex-start; gap: .55rem; max-width: 46rem; margin: 1rem 0; }
.checkbox-field input { margin-top: .24rem; }
.chat-delete-actions { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: flex-end; }

/* Activity profiles and page-level access management. */
.permission-menu-editor { margin: 1.35rem 0; padding: 1.1rem; border: 1px solid var(--color-border); border-radius: .55rem; background: color-mix(in srgb, var(--color-surface) 88%, var(--color-accent) 12%); }
.permission-menu-editor .panel-header { margin-bottom: .85rem; }
.permission-menu-group { margin: 1rem 0; }
.permission-menu-group h3 { margin: 0 0 .55rem; font-size: 1rem; }
.permission-menu-group-collapsible { border: 1px solid var(--color-border); border-radius: .45rem; overflow: hidden; background: var(--color-surface); }
.permission-menu-group-collapsible summary { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .8rem .95rem; cursor: pointer; font-size: 1rem; font-weight: 700; list-style: none; }
.permission-menu-group-collapsible summary::-webkit-details-marker { display: none; }
.permission-menu-group-collapsible summary::after { content: '⌄'; color: var(--color-muted); transition: transform .15s ease; }
.permission-menu-group-collapsible[open] summary::after { transform: rotate(180deg); }
.permission-menu-group-collapsible summary small { margin-left: auto; color: var(--color-muted); font-size: .78rem; font-weight: 600; }
.permission-menu-group-collapsible .permission-access-list { padding: .2rem .95rem .95rem; border-top: 1px solid var(--color-border); }
.permission-profile-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin: .7rem 0 1rem; }
.permission-profile-actions small { color: var(--color-muted); }
.header-chat-link { position: relative; }
.header-chat-link .chat-header-unread { position: absolute; top: -.38rem; right: -.32rem; }

@media (max-width: 900px) {
  .chat-layout, .chat-conversation-grid { grid-template-columns: 1fr; }
  .chat-channel-panel, .chat-members-panel { position: static; }
  .chat-channel-list { max-height: 19rem; }
}

@media (max-width: 640px) {
  .chat-create-grid { grid-template-columns: 1fr; }
  .chat-title-row { flex-direction: column; }
  .chat-header-actions { justify-content: flex-start; }
  .chat-conversation-header, .chat-message, .chat-compose { padding: .8rem; }
}

.project-create-estimate-table-wrap {
  margin-top: 0.9rem;
}

.project-create-estimate-table .project-create-product-line {
  display: table-row;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.project-create-estimate-table .project-create-product-line > strong,
.project-create-estimate-table .project-create-product-line > .table-action {
  grid-column: auto;
  justify-self: auto;
}

.project-create-estimate-table .estimate-edit-input.is-locked {
  pointer-events: none;
}

.data-table.project-create-estimate-table th,
.data-table.project-create-estimate-table td {
  padding: 0.5rem 0.45rem;
  font-size: 0.82rem;
  line-height: 1.3;
}

.data-table.project-create-estimate-table th {
  font-size: 0.72rem;
  letter-spacing: 0.025em;
}

.project-create-estimate-table td[data-label="Categoria"] {
  color: var(--color-muted);
  font-size: 0.78rem;
}

.project-create-estimate-table td[data-label="Categoria"] span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-create-estimate-table td[data-label="Designação"] strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--color-text);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.data-table.project-create-estimate-table .project-create-product-line > td {
  vertical-align: middle;
}

.project-create-estimate-table .estimate-edit-input {
  padding-block: 0.3rem;
  font-size: 0.8rem;
}

.project-create-product-line {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: end;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}

.project-create-product-line > strong {
  align-self: center;
  grid-column: span 5;
}

.project-create-product-line > .table-action {
  justify-self: end;
}

.project-create-product-metrics {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding-top: 0.2rem;
  color: var(--color-muted);
  font-size: 0.82rem;
}

.project-create-product-metrics strong {
  color: var(--color-text);
}

.project-create-product-metrics strong.margin-healthy,
.project-create-estimate-summary strong.margin-healthy {
  color: #bcf1d3;
}

.project-create-product-metrics strong.margin-warning,
.project-create-estimate-summary strong.margin-warning {
  color: #ffe1a3;
}

.project-create-product-metrics strong.margin-danger,
.project-create-estimate-summary strong.margin-danger {
  color: #ffd3d3;
}

.project-create-estimate-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.project-create-estimate-summary > div {
  display: grid;
  gap: 0.25rem;
  padding: 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}

.project-create-estimate-summary span {
  color: var(--color-muted);
  font-size: 0.78rem;
}

.project-create-estimate-summary strong {
  color: var(--color-text);
}

.project-required-field {
  padding: 0.65rem;
  border: 1px solid rgba(255, 102, 102, 0.78);
  border-radius: 8px;
  background: rgba(255, 102, 102, 0.09);
}

.project-required-field.is-complete {
  border-color: rgba(95, 210, 145, 0.82);
  background: rgba(95, 210, 145, 0.1);
}

.project-required-field.is-complete .field-label::after {
  content: " ✓";
  color: #bcf1d3;
}

.field-member_checkboxes {
  grid-column: span 3;
}

.member-picker {
  display: grid;
  gap: 0.65rem;
  padding: 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: rgba(8, 17, 27, 0.38);
}

.member-picker-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.member-picker-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.member-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  background: var(--color-surface-soft);
}

.member-option input {
  width: auto;
}

.team-task-category-section {
  display: grid;
  gap: 0.7rem;
}

.team-task-category-picker {
  display: grid;
  gap: 0.7rem;
  padding: 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: rgba(8, 17, 27, 0.38);
}

.team-task-category-tools {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.team-task-category-search {
  flex: 1 1 16rem;
}

.team-task-category-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.team-task-category-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  background: var(--color-surface-soft);
  cursor: pointer;
}

.team-task-category-option input {
  width: auto;
  flex: 0 0 auto;
}

.team-task-category-option > span:not(.sr-only) {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
}

.team-task-category-option strong,
.team-task-category-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-task-category-option small {
  color: var(--color-muted);
  font-size: 0.76rem;
  font-weight: 400;
}

.team-task-category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.team-task-category-tag {
  display: inline-flex;
  max-width: 11rem;
  overflow: hidden;
  padding: 0.22rem 0.48rem;
  border: 1px solid rgba(255, 132, 38, 0.48);
  border-radius: 999px;
  color: var(--color-text);
  background: rgba(255, 132, 38, 0.12);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-task-category-empty {
  color: var(--color-muted);
  font-size: 0.82rem;
}

@media (max-width: 760px) {
  .team-task-category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .team-task-category-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.field-label {
  color: var(--color-text);
  font-weight: 700;
}

.field-message {
  color: var(--color-danger);
  font-size: 0.86rem;
}

.field-help {
  color: var(--color-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.field-error input,
.field-error select,
.field-error textarea {
  border-color: rgba(255, 102, 102, 0.72);
  background: rgba(255, 102, 102, 0.08);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-top: 0.25rem;
}

.project-opn-external-provider-choice {
  display: grid;
  flex: 1 0 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--color-primary);
  border-radius: calc(var(--radius) + 2px);
  background: var(--color-primary-soft);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.project-opn-external-provider-choice[hidden] {
  display: none;
}

.project-opn-external-provider-copy {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.project-opn-external-provider-step {
  flex: 0 0 auto;
  padding: 0.32rem 0.5rem;
  border: 1px solid var(--color-primary);
  border-radius: 999px;
  color: var(--color-primary-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.project-opn-external-provider-copy strong {
  display: block;
}

.project-opn-external-provider-copy p {
  margin: 0.2rem 0 0;
  color: var(--color-muted);
  font-size: 0.86rem;
}

.project-opn-external-provider-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.5rem;
}

.project-opn-external-provider-options .button {
  min-height: 38px;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
}

.project-opn-external-provider-no {
  border-color: var(--color-primary);
  color: var(--color-primary-strong);
  background: var(--color-surface);
}

.project-opn-external-provider-no:hover,
.project-opn-external-provider-no:focus-visible {
  color: #111c2b;
  background: var(--color-primary-strong);
}

@media (max-width: 720px) {
  .project-opn-external-provider-choice {
    grid-template-columns: 1fr;
  }

  .project-opn-external-provider-options {
    justify-content: start;
  }
}

.workflow-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.8rem;
  margin-top: 1rem;
}

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

.workflow-form-grid-wide {
  grid-column: 1 / -1;
}

.workflow-actions,
.table-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.7rem;
}

.task-running-timer {
  position: sticky;
  top: 0.75rem;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid #f3a13a;
  border-radius: var(--radius);
  background: #a84f08;
  color: #fff;
  box-shadow: 0 12px 28px rgba(134, 57, 3, 0.28);
}

.task-running-timer > div {
  display: grid;
  gap: 0.15rem;
}

.task-running-timer span {
  color: #ffe3bb;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.task-running-timer strong {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1;
}

.task-running-timer p {
  margin: 0.2rem 0 0;
  color: #fff;
}

.task-running-timer .button-danger {
  border-color: #fff;
  background: #fff;
  color: #a84f08;
}

.task-running-timer .button-danger:hover {
  border-color: #fff0d9;
  background: #fff0d9;
  color: #8d4105;
}

.direct-time-panel {
  margin-bottom: 1rem;
}

.direct-time-actions,
.direct-time-running,
.direct-time-manual-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem;
}

.direct-time-running {
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border: 1px solid #f3a13a;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 84%, #f3a13a);
}

.direct-time-running > div {
  display: grid;
  gap: 0.16rem;
}

.direct-time-running span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.direct-time-running strong {
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-variant-numeric: tabular-nums;
}

.direct-time-running p {
  margin: 0;
}

.direct-time-manual {
  margin-top: 0.9rem;
}

.direct-time-manual summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 750;
}

.direct-time-manual-form {
  margin-top: 0.8rem;
}

.direct-time-manual-form .field {
  min-width: 10rem;
}

.direct-time-manual-form .direct-time-notes {
  flex: 1 1 16rem;
}

.direct-time-no-js-stop {
  display: grid;
  gap: 0.7rem;
  width: 100%;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid color-mix(in srgb, #f3a13a 48%, var(--color-border));
}

.direct-time-no-js-stop textarea {
  width: 100%;
  resize: vertical;
}

.direct-time-stop-dialog {
  width: min(100% - 2rem, 36rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 1.25);
  color: var(--color-text);
  background: var(--color-surface-elevated);
  box-shadow: 0 1.2rem 3.8rem rgb(15 23 42 / 32%);
}

.direct-time-stop-dialog::backdrop {
  background: rgb(15 23 42 / 54%);
}

.direct-time-stop-dialog form {
  display: grid;
  gap: 1rem;
  padding: 1.15rem;
}

.direct-time-stop-dialog .field {
  min-width: 0;
}

.direct-time-stop-dialog textarea {
  width: 100%;
  resize: vertical;
}

.direct-time-stop-dialog small {
  color: var(--color-muted);
}

.direct-time-stop-dialog-header,
.direct-time-stop-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.direct-time-stop-dialog-header h2 {
  margin: 0;
}

.direct-time-stop-dialog-header .eyebrow {
  margin: 0 0 0.2rem;
}

.direct-time-stop-dialog-actions {
  justify-content: flex-end;
  padding-top: 0.15rem;
}

.direct-time-stop-status {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--color-danger) 45%, var(--color-border));
  border-radius: var(--radius);
  color: var(--color-danger-strong);
  background: color-mix(in srgb, var(--color-danger) 10%, var(--color-surface-elevated));
  font-weight: 700;
}

.direct-time-stop-dialog.is-fallback-open {
  position: fixed;
  inset: 1rem;
  z-index: 1200;
  width: auto;
  max-width: 36rem;
  max-height: max-content;
}

body.has-direct-time-stop-dialog-open {
  overflow: hidden;
}

.direct-time-records {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--color-border);
}

.direct-time-records > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}

.direct-time-records > summary::-webkit-details-marker { display: none; }
.direct-time-records > summary > div { min-width: 0; }
.direct-time-records > summary h3 { margin: 0; }
.direct-time-records > summary p { margin: 0.22rem 0 0; color: var(--color-muted); }
.direct-time-records > summary small { color: var(--color-primary-strong); font-size: 0.78rem; font-weight: 800; white-space: nowrap; }
.direct-time-records > summary::after { content: '⌄'; flex: 0 0 auto; color: var(--color-primary-strong); font-size: 1.2rem; font-weight: 800; transition: transform 160ms ease; }
.direct-time-records[open] > summary::after { transform: rotate(180deg); }
.direct-time-records[open] > summary small { font-size: 0; }
.direct-time-records[open] > summary small::after { content: 'Recolher'; font-size: 0.78rem; }
.direct-time-records-content { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--color-border); }

.direct-time-records-table {
  margin-top: 0.75rem;
}

.direct-time-record-detail small {
  display: block;
  margin-top: 0.35rem;
  color: var(--color-muted);
}

.direct-time-record-actions {
  min-width: 17rem;
}

.direct-time-record-edit,
.direct-time-record-history {
  margin: 0.2rem 0;
}

.direct-time-record-edit > summary,
.direct-time-record-history > summary {
  cursor: pointer;
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.direct-time-record-edit-form {
  display: grid;
  gap: 0.65rem;
  min-width: 19rem;
  margin-top: 0.55rem;
  padding: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--color-primary-soft) 42%, var(--color-surface-elevated));
}

.direct-time-record-edit-form .field {
  min-width: 0;
}

.direct-time-duration-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0;
  padding: 0.55rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.direct-time-duration-fields legend {
  padding: 0 0.25rem;
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.direct-time-edit-notes textarea,
.direct-time-change-reason textarea {
  width: 100%;
  resize: vertical;
}

.direct-time-change-reason {
  padding: 0.65rem;
  border: 1px solid color-mix(in srgb, var(--color-warning) 56%, var(--color-border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--color-warning) 14%, var(--color-surface-elevated));
}

.direct-time-change-reason small {
  color: var(--color-muted);
  font-size: 0.76rem;
}

.direct-time-record-history .timeline-list {
  min-width: 19rem;
  margin-top: 0.55rem;
}

.direct-time-record-history .timeline-item small {
  display: block;
  margin-top: 0.25rem;
}

@media (max-width: 640px) {
  .direct-time-running {
    align-items: stretch;
  }

  .direct-time-running .button {
    width: 100%;
  }

  .direct-time-stop-dialog {
    width: min(100% - 1rem, 36rem);
  }

  .direct-time-stop-dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .direct-time-stop-dialog-actions .button {
    width: 100%;
  }

  .direct-time-record-actions,
  .direct-time-record-edit-form,
  .direct-time-record-history .timeline-list {
    min-width: 0;
  }

  .direct-time-duration-fields {
    grid-template-columns: 1fr;
  }
}

.my-tasks-intro {
  margin-bottom: 1rem;
}

.my-tasks-intro .panel-header {
  margin-bottom: 0.7rem;
}

.my-tasks-project-context {
  margin-top: 1rem;
}

.my-tasks-project-context > * {
  min-width: 0;
}

.my-tasks-project-context .detail-fields {
  grid-template-columns: 1fr;
  gap: 0;
}

.my-tasks-project-context .detail-field {
  grid-template-columns: minmax(10rem, 32%) minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  padding: 0.45rem 0;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
}

.my-tasks-project-context .detail-field:last-child {
  border-bottom: 0;
}

.my-tasks-filter-form {
  display: grid;
  grid-template-columns: minmax(13rem, 1.6fr) repeat(5, minmax(9rem, 1fr)) auto;
  gap: 0.75rem;
  align-items: end;
}

.team-tasks-filter-form {
  grid-template-columns: minmax(13rem, 1.6fr) repeat(4, minmax(9rem, 1fr)) auto;
}

.my-tasks-filter-search {
  min-width: 0;
}

.my-tasks-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.my-tasks-filter-actions .button {
  white-space: nowrap;
}

.my-tasks-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.my-tasks-metrics .metric-card {
  min-height: 96px;
}

.task-workspace-status {
  margin: 0.85rem 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid #3f9d61;
  border-radius: var(--radius);
  background: rgba(35, 125, 70, 0.2);
  color: #d8ffe4;
  font-weight: 700;
}

.task-workspace-status.task-workspace-status-error {
  border-color: rgba(255, 102, 102, 0.65);
  background: rgba(170, 45, 45, 0.2);
  color: #ffd2d2;
}

.my-tasks-project-list {
  display: grid;
  gap: 0.85rem;
}

.my-task-project {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.my-task-priority-danger {
  border-left-color: var(--color-danger);
}

.my-task-priority-warning {
  border-left-color: var(--color-accent);
}

.my-task-priority-success {
  border-left-color: var(--color-success);
}

.my-task-project > summary {
  display: grid;
  grid-template-columns: minmax(15rem, 1.15fr) minmax(16rem, 1fr);
  gap: 0.85rem 1.25rem;
  align-items: center;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
}

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

.my-task-project > summary::after {
  content: '⌄';
  grid-column: 2;
  justify-self: end;
  color: var(--color-muted);
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.16s ease;
}

.my-task-project[open] > summary::after {
  transform: rotate(180deg);
}

.my-task-project-title,
.my-task-project-meta,
.my-task-project-info,
.my-task-line-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  min-width: 0;
}

.my-task-project-title strong {
  color: var(--color-text);
  font-size: 1rem;
}

.my-task-project-title span {
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.my-task-project-title small,
.my-task-project-info,
.my-task-task-name small {
  color: var(--color-muted);
}

.task-registered-time.has-time,
.project-task-real.has-time {
  color: #ffb7b7;
  font-weight: 800;
}

.my-task-project-meta {
  padding-right: 1.35rem;
}

.my-task-category,
.my-task-delivery,
.my-task-priority-label,
.my-task-suspended {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0.1rem 0.42rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.my-task-category {
  color: var(--color-accent);
}

/* Assuntos das mensagens de projeto. A cor pertence ao assunto, não ao
   estado da mensagem, pelo que é consistente na lista e no detalhe. */
.note-subject-tag {
  --note-subject-color: #64748b;
  border-color: color-mix(in srgb, var(--note-subject-color) 58%, var(--color-border));
  color: color-mix(in srgb, var(--note-subject-color) 62%, var(--color-text));
  background: color-mix(in srgb, var(--note-subject-color) 15%, var(--color-surface));
}
.note-subject-color-green { --note-subject-color: #0f8a5f; }
.note-subject-color-orange { --note-subject-color: #d97706; }
.note-subject-color-yellow { --note-subject-color: #a16207; }
.note-subject-color-red { --note-subject-color: #c2413b; }
.note-subject-color-blue { --note-subject-color: #2563eb; }
.note-subject-color-slate { --note-subject-color: #64748b; }
.note-subject-color-purple { --note-subject-color: #7c3aed; }
.note-subject-color-indigo { --note-subject-color: #312e81; }
.note-subject-color-cyan { --note-subject-color: #087ea4; }
.note-subject-color-teal { --note-subject-color: #0f766e; }
.note-subject-color-pink { --note-subject-color: #be185d; }
.note-subject-color-rose { --note-subject-color: #881337; }
.note-subject-color-lime { --note-subject-color: #4d7c0f; }
.note-subject-color-brown { --note-subject-color: #7c2d12; }

.my-task-delivery.is-overdue,
.my-task-suspended {
  border-color: rgba(255, 102, 102, 0.6);
  color: #ffb7b7;
}

.my-task-project-body {
  border-top: 1px solid var(--color-border);
}

.my-task-project-info {
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.82rem;
}

.my-task-project-info a {
  color: var(--color-primary-strong);
  font-weight: 700;
}

.my-task-project-info a.button {
  color: var(--color-text);
}

.team-task-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
}

.team-task-assignees {
  color: var(--color-text);
  font-weight: 700;
}

.my-task-task-list {
  display: grid;
}

.my-task-task-row {
  display: grid;
  grid-template-columns: minmax(3.6rem, auto) minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.68rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

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

.my-task-task-row.is-running {
  background: rgba(235, 128, 20, 0.12);
}

.validation-task-row {
  border-left: 4px solid transparent;
}

.validation-task-row.validation-task-awaiting_validation {
  border-left-color: #3f9d61;
  background: rgba(35, 125, 70, 0.14);
}

.validation-task-row.validation-task-validated {
  border-left-color: #5f8fd8;
  background: rgba(63, 111, 183, 0.15);
}

.validation-task-row.validation-task-assigned {
  border-left-color: #d99222;
  background: rgba(217, 146, 34, 0.14);
}

.validation-task-row.validation-task-unassigned {
  border-left-color: var(--color-danger);
  background: rgba(190, 55, 55, 0.12);
}

.validation-task-status {
  display: inline-flex;
  width: fit-content;
  padding: 0.14rem 0.48rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 800;
  line-height: 1.25;
}

.validation-task-status-awaiting_validation {
  color: #d8ffe4;
  border-color: #3f9d61;
  background: rgba(35, 125, 70, 0.28);
}

.validation-task-status-validated {
  color: #dbe9ff;
  border-color: #5f8fd8;
  background: rgba(63, 111, 183, 0.28);
}

.validation-task-status-assigned {
  color: #ffe7bd;
  border-color: #d99222;
  background: rgba(217, 146, 34, 0.24);
}

.validation-task-status-unassigned {
  color: #ffd5d5;
  border-color: var(--color-danger);
  background: rgba(190, 55, 55, 0.22);
}

.my-task-completion-row {
  grid-template-columns: auto minmax(3.6rem, auto) minmax(0, 1fr) auto;
}

.my-task-task-name {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.my-task-task-name strong {
  overflow-wrap: anywhere;
}

.my-task-line-actions {
  justify-content: flex-end;
}

.my-task-line-actions form {
  margin: 0;
}

.my-task-line-actions .table-action {
  min-height: 2rem;
}

.my-tasks-empty {
  margin: 0;
}

.my-tasks-flow-dialog {
  width: min(38rem, calc(100vw - 2rem));
  max-height: min(44rem, calc(100vh - 2rem));
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

.my-tasks-flow-dialog[hidden] {
  display: none;
}

.my-tasks-flow-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.my-tasks-flow-dialog.is-fallback-open {
  position: fixed;
  inset: 1rem;
  z-index: 1100;
  display: block;
  height: fit-content;
  margin: auto;
}

body.has-my-tasks-flow-dialog-open {
  overflow: hidden;
}

.my-tasks-flow-dialog-content {
  display: grid;
  gap: 0.9rem;
  padding: 1.1rem;
  overflow: auto;
}

.my-tasks-flow-dialog-header,
.my-tasks-flow-dialog-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.my-tasks-flow-dialog-header {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--color-border);
}

.my-tasks-flow-dialog-header h2,
.my-tasks-flow-dialog-header p,
.my-tasks-flow-dialog-status {
  margin: 0;
}

.my-tasks-flow-dialog-header h2 {
  font-size: 1.15rem;
}

.my-tasks-flow-dialog-header p,
.my-tasks-flow-dialog-status {
  color: var(--color-muted);
  font-size: 0.88rem;
}

.my-tasks-flow-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  max-height: 20rem;
  overflow: auto;
  padding: 0.15rem;
}

.my-tasks-flow-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background: var(--color-panel);
  color: var(--color-text);
  cursor: pointer;
  font-weight: 700;
}

.my-tasks-flow-option:hover,
.my-tasks-flow-option.is-selected {
  border-color: var(--color-primary-strong);
  background: var(--color-primary-soft);
}

.my-tasks-flow-option input {
  width: 1.05rem;
  min-width: 1.05rem;
  height: 1.05rem;
  min-height: 1.05rem;
  margin: 0;
}

.my-tasks-flow-option span {
  overflow-wrap: anywhere;
}

.my-tasks-flow-dialog-actions {
  align-items: center;
  justify-content: flex-end;
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-border);
}

@media (max-width: 560px) {
  .my-tasks-flow-options {
    grid-template-columns: 1fr;
  }

  .my-tasks-flow-dialog-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
}

.compact-task-filter-form {
  grid-template-columns: minmax(15rem, 1.7fr) repeat(2, minmax(11rem, 1fr)) auto;
}

.task-assigned-project-filter {
  grid-template-columns: minmax(15rem, 1.7fr) auto;
}

.validation-tasks-filter-form {
  grid-template-columns: minmax(14rem, 1.6fr) repeat(2, minmax(10rem, 1fr)) auto;
}

.task-workspace-bulk,
.messages-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.task-workspace-bulk .field {
  min-width: min(100%, 20rem);
  margin: 0;
}

.task-workspace-select-all {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  gap: 0.5rem;
  color: var(--color-text);
  font-weight: 700;
}

.my-tasks-bulk-completion {
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
}

/* Productivity dashboard -------------------------------------------------- */
.productivity-intro {
    overflow: visible;
}

.productivity-intro .panel-header {
    align-items: flex-start;
    gap: 1rem 2rem;
}

.eyebrow {
    margin: 0 0 .35rem;
    color: var(--color-accent, #eb7a18);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.productivity-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .45rem;
    max-width: 36rem;
}

.risk-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    padding: .3rem .52rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .71rem;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
}

.risk-success { background: rgba(49, 180, 117, .13); border-color: rgba(49, 180, 117, .3); color: #168152; }
.risk-warning { background: rgba(238, 170, 32, .14); border-color: rgba(238, 170, 32, .34); color: #996600; }
.risk-danger { background: rgba(235, 122, 24, .15); border-color: rgba(235, 122, 24, .34); color: #b65508; }
.risk-critical { background: rgba(190, 49, 58, .13); border-color: rgba(190, 49, 58, .32); color: #a82934; }
.risk-neutral { background: rgba(102, 117, 138, .12); border-color: rgba(102, 117, 138, .25); color: #536174; }

.productivity-filter-form {
    grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
    margin-top: 1rem;
}

.productivity-metric-grid {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}
.productivity-metric-grid .metric-card { min-height: 10.5rem; }
.productivity-metric-description { display: block; margin-top: .55rem; color: var(--color-muted); font-size: .72rem; line-height: 1.4; }

.productivity-chart-panel,
.productivity-project-panel {
    margin-top: 1rem;
}

.productivity-collapsible {
    padding: 0;
}

.productivity-collapsible > summary {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .9rem 1rem;
    cursor: pointer;
    list-style: none;
}

.productivity-collapsible > summary::-webkit-details-marker { display: none; }

.productivity-collapsible > summary::before {
    content: '⌄';
    flex: 0 0 auto;
    color: var(--color-primary-strong);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
    transition: transform .16s ease;
}

.productivity-collapsible:not([open]) > summary::before { transform: rotate(-90deg); }

.productivity-collapsible > summary:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--color-accent) 45%, transparent);
    outline-offset: -3px;
}

.productivity-collapsible-heading {
    display: grid;
    min-width: 0;
    gap: .18rem;
}

.productivity-collapsible-heading .eyebrow {
    display: block;
    margin: 0;
}

.productivity-collapsible-title {
    color: var(--color-text);
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.25;
}

.productivity-collapsible-state {
    margin-left: auto;
    color: var(--color-muted);
    font-size: .78rem;
    font-weight: 650;
    white-space: nowrap;
}

.productivity-collapsible[open] > summary .productivity-collapsible-state { font-size: 0; }
.productivity-collapsible[open] > summary .productivity-collapsible-state::after {
    content: 'Fechar';
    font-size: .78rem;
}

.productivity-collapsible-content {
    padding: .95rem 1rem 1rem;
    border-top: 1px solid var(--color-border);
}

.productivity-collapsible-description {
    margin: 0 0 .9rem;
    color: var(--color-muted);
}

.productivity-bars {
    display: grid;
    gap: .85rem;
}

.productivity-bar-row {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(240px, 2.4fr) minmax(220px, 1.15fr);
    align-items: center;
    gap: 1rem;
}

.productivity-bar-label {
    display: grid;
    gap: .18rem;
    min-width: 0;
}

.productivity-bar-label a {
    color: inherit;
    font-weight: 800;
    text-decoration: none;
}

.productivity-bar-label a:hover { color: var(--color-accent, #eb7a18); }
.productivity-bar-label small,
.productivity-table small { color: var(--color-text-muted, #7f8a99); display: block; }

.productivity-bar-track {
    position: relative;
    height: 1.3rem;
    overflow: hidden;
    border: 1px solid var(--color-border, #dfe4eb);
    border-radius: .45rem;
    background: rgba(115, 129, 148, .09);
}

.productivity-bar-track span {
    position: absolute;
    left: 0;
    display: block;
    min-width: 2px;
    border-radius: .32rem;
}

.productivity-bar-track .bar-planned { top: .27rem; height: .32rem; background: #7795bb; }
.productivity-bar-track .bar-actual { bottom: .25rem; height: .37rem; background: var(--color-accent, #eb7a18); }

.productivity-bar-values {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .42rem .65rem;
    color: var(--color-text-muted, #7f8a99);
    font-size: .78rem;
}

.productivity-table td { white-space: nowrap; }
.productivity-table td:first-child { white-space: normal; min-width: 190px; }
.productivity-table small { margin-top: .18rem; font-size: .72rem; }
.number-negative { color: #bd3340 !important; font-weight: 750; }

.productivity-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.productivity-deviation-panel { margin: 1rem 0; }
.productivity-deviation-list { display: grid; gap: .75rem; }
.productivity-deviation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--color-border, #dfe4eb);
    border-left: 3px solid var(--color-accent, #eb7a18);
    border-radius: .55rem;
    background: var(--color-surface-soft, rgba(115, 129, 148, .04));
}
.productivity-deviation-item a { color: inherit; text-decoration: none; }
.productivity-deviation-item p { margin: .35rem 0 0; color: var(--color-text-muted, #7f8a99); font-size: .82rem; }
.productivity-deviation-item .risk-badge { margin-left: .5rem; vertical-align: middle; }
.productivity-deviation-reasons,
.planning-productivity-deviation-reasons {
    margin-top: .62rem;
    padding: .55rem .65rem;
    border-left: 2px solid var(--color-accent, #eb7a18);
    border-radius: .35rem;
    background: var(--color-surface-soft, rgba(115, 129, 148, .04));
}
.productivity-deviation-reasons > strong,
.planning-productivity-deviation-reasons > strong {
    display: block;
    color: var(--color-text, inherit);
    font-size: .76rem;
    font-weight: 800;
}
.productivity-deviation-reasons > div,
.planning-productivity-deviation-reasons > div {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .28rem;
}
.productivity-reason-summary { display: inline-block; margin: .4rem .45rem 0 0; color: var(--color-text-muted, #7f8a99); }
.productivity-deviation-reasons .productivity-reason-summary,
.planning-productivity-deviation-reasons .productivity-reason-summary {
    margin: 0;
    padding: .18rem .42rem;
    border: 1px solid var(--color-border, #dfe4eb);
    border-radius: 999px;
    background: var(--color-surface, transparent);
}
.productivity-deviation-item details { flex: 0 0 auto; }
.productivity-deviation-item summary { cursor: pointer; color: var(--color-accent, #eb7a18); font-weight: 750; }
.productivity-deviation-form {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) minmax(110px, .45fr) minmax(180px, 1fr) auto;
    align-items: end;
    gap: .55rem;
    width: min(100%, 720px);
    margin-top: .7rem;
}
.productivity-deviation-form .field { margin: 0; }
.productivity-deviation-dialog { width: min(620px, calc(100vw - 2rem)); }
.productivity-deviation-dialog[hidden] { display: none; }
.productivity-deviation-dialog.is-fallback-open {
    position: fixed;
    inset: 1rem;
    z-index: 1100;
    display: block;
    height: fit-content;
    margin: auto;
}
body.has-productivity-deviation-dialog-open { overflow: hidden; }
.productivity-deviation-dialog-context { margin: 0 2.5rem .9rem 0; color: var(--color-muted); font-size: .86rem; line-height: 1.45; }
.productivity-deviation-dialog .productivity-deviation-form { grid-template-columns: 1fr; width: 100%; margin-top: 0; }
.productivity-deviation-dialog .productivity-deviation-form .button { justify-self: end; }
body.theme-contrast .productivity-deviation-dialog { border-width: 2px; }
body.theme-contrast .productivity-deviation-reasons,
body.theme-contrast .planning-productivity-deviation-reasons { border: 2px solid currentColor; }

.productivity-breakdown-grid .panel { min-width: 0; }
.compact-table { font-size: .82rem; }
.compact-table th, .compact-table td { padding: .62rem .65rem; }

@media (max-width: 1180px) {
    .productivity-metric-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
    .productivity-breakdown-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .productivity-intro .panel-header { flex-direction: column; }
    .productivity-legend { justify-content: flex-start; }
    .productivity-collapsible > summary { align-items: flex-start; }
    .productivity-bar-row { grid-template-columns: 1fr; gap: .45rem; }
    .productivity-metric-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
    .productivity-deviation-item { align-items: stretch; flex-direction: column; }
    .productivity-deviation-form { grid-template-columns: 1fr; }
}

.my-tasks-bulk-completion .task-workspace-select-all {
  min-height: 2.35rem;
  font-size: 0.9rem;
}

.my-tasks-bulk-completion .button {
  min-height: 2.35rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
}

.task-assignment-row {
  grid-template-columns: 1.2rem minmax(4.5rem, 7rem) minmax(0, 1fr);
  gap: 0.5rem 0.65rem;
  min-width: 0;
  padding: 0.55rem 0.7rem;
}

/* The distribution may contain many tasks. Present the compact selectable
   rows in responsive columns instead of one long, visually noisy list. */
.task-assignment-task-list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 0.55rem;
  padding: 0.55rem;
}

.task-assignment-task-list .task-assignment-row {
  min-height: 5.1rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: calc(var(--radius) - 2px);
}

.task-assignment-task-list .task-assignment-row:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.task-assignment-row .task-select {
  min-width: 1.2rem;
}

.task-assignment-row .task-select input {
  inline-size: 0.92rem;
  block-size: 0.92rem;
  margin: 0;
}

/* The validation rows also have action buttons. Keep those buttons in their
   own right-hand column rather than letting CSS Grid create an implicit row. */
.validation-task-row.task-assignment-row {
  grid-template-columns: auto minmax(3.6rem, auto) minmax(0, 1fr) auto;
}

.task-inline-assignment {
  display: flex;
  align-items: end;
  gap: 0.45rem;
}

.task-inline-assignment .field {
  min-width: min(100%, 15rem);
  margin: 0;
}

.task-inline-assignment input[type="search"] {
  min-width: 14rem;
}

.task-assignment-status,
.task-distribution-complete {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
}

.task-assignment-status.is-unassigned {
  color: #ffe4b8;
  border-color: #bd781e;
  background: rgba(191, 113, 19, 0.18);
}

.task-assignment-status.is-assigned,
.task-distribution-complete {
  color: #d8ffe4;
  border-color: #3f9d61;
  background: rgba(35, 125, 70, 0.2);
}

.task-distribution-completion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.task-distribution-completion p {
  margin: 0;
  color: var(--color-muted);
}

.task-select,
.message-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
}

.task-select input,
.message-select input {
  inline-size: 1rem;
  block-size: 1rem;
}

.table-action-validate {
  min-width: 2rem;
  color: #e0ffe7;
  border-color: #3d9b61;
  background: #1f7042;
  font-weight: 900;
}

.table-action-validate:hover {
  color: #fff;
  border-color: #55be78;
  background: #2c8b52;
}

.user-times-intro,
.user-times-panel,
.messages-intro {
  margin-bottom: 1rem;
}

.user-times-filter,
.messages-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem;
}

.user-times-filter .field {
  width: 9.5rem;
}

.user-times-range {
  padding-bottom: 0.55rem;
  color: var(--color-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.user-times-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.user-times-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: -0.25rem 0 0.75rem;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.user-times-key::before {
  content: '';
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.28rem;
  border-radius: 2px;
  background: currentColor;
}

.user-times-key.is-tasks { color: #8ca5d9; }
.user-times-key.is-admin { color: #cc8eb1; }
.user-times-key.is-training { color: #71b8bd; }
.user-times-key.is-goal { color: var(--color-text); }
.user-times-key.is-goal::before { width: .18rem; border-radius: 0; }

.user-times-list {
  display: grid;
}

.user-times-row {
  display: grid;
  grid-template-columns: minmax(10rem, 0.7fr) minmax(12rem, 2fr) minmax(10rem, 0.75fr) minmax(15rem, 1fr);
  align-items: center;
  gap: 0.85rem;
  padding: 0.72rem 0;
  border-top: 1px solid var(--color-border);
}

.user-times-user,
.user-times-total,
.user-times-breakdown {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.user-times-user small,
.user-times-total span,
.user-times-breakdown,
.user-times-breakdown small {
  color: var(--color-muted);
  font-size: 0.78rem;
}

.user-times-track {
  height: 0.8rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.user-times-goal-area {
  fill: color-mix(in srgb, var(--color-text) 12%, transparent);
  stroke: color-mix(in srgb, var(--color-text) 32%, transparent);
  stroke-width: .35;
}

.user-times-goal-marker {
  stroke: var(--color-text);
  stroke-width: .8;
  vector-effect: non-scaling-stroke;
}

.user-times-chart {
  display: block;
  width: 100%;
  height: 100%;
}

.user-times-chart .is-tasks { fill: #8ca5d9; }
.user-times-chart .is-admin { fill: #cc8eb1; }
.user-times-chart .is-training { fill: #71b8bd; }

.user-times-total small { font-size: .74rem; font-weight: 750; }
.user-times-total span b { color: var(--color-text); font-size: .9rem; }
.user-times-total small.is-over { color: #27835e; }
.user-times-total small.is-under { color: var(--color-danger); }
.user-times-total small.is-on-target { color: #af6a11; }

.user-times-breakdown {
  grid-template-columns: repeat(3, auto);
  column-gap: 0.55rem;
}

.user-times-category {
  display: grid;
  gap: .08rem;
  min-width: 0;
}

.user-times-category > span {
  color: var(--color-muted);
  font-size: .68rem;
  font-weight: 750;
}

.user-times-category > strong { font-size: .84rem; }
.user-times-category > small { color: var(--color-muted); font-size: .67rem; }
.user-times-category.is-admin > strong { color: #cc8eb1; }
.user-times-category.is-training > strong { color: #71b8bd; }

.user-times-breakdown > .user-times-projects {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
}

.user-times-week-goal {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .28rem;
  margin-top: .16rem;
}

.user-times-day {
  display: grid;
  gap: .06rem;
  min-width: 0;
  padding: .26rem .2rem;
  border: 1px solid var(--color-border);
  border-radius: .32rem;
  background: var(--color-surface-elevated);
  text-align: center;
}

.user-times-day b { color: var(--color-text); font-size: .67rem; }
.user-times-day small { color: var(--color-muted); font-size: .64rem; white-space: nowrap; }
.user-times-day.is-holiday,
.user-times-day.is-vacation,
.user-times-day.is-absence,
.user-times-day.is-before-admission { opacity: .58; }
.user-times-day.is-partial-absence,
.user-times-day.is-birthday { border-color: color-mix(in srgb, var(--color-accent) 60%, var(--color-border)); }

.messages-filter-form {
  display: grid;
  grid-template-columns: minmax(14rem, 1.75fr) repeat(5, minmax(9rem, 1fr)) auto;
}

.messages-search { min-width: 0; }
.messages-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.message-history-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.message-history-tabs a {
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.38rem 0.8rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.message-history-tabs a:hover,
.message-history-tabs a.is-active {
  color: #fff;
  border-color: #70b6ff;
  background: rgba(69, 139, 217, 0.22);
}

.message-list { display: grid; }

.messages-bulk-actions[data-project-notes-bulk-actions] {
  align-items: center;
  border-color: color-mix(in srgb, var(--color-primary) 38%, var(--color-border));
}

.messages-bulk-selection-summary {
  flex: 1 1 18rem;
  margin: 0;
  color: var(--color-muted);
  font-weight: 700;
}

.message-project-bulk-selection {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.9rem;
  margin: 0.7rem 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 0.8);
  background: color-mix(in srgb, var(--color-surface) 88%, var(--color-primary));
}

.message-project-bulk-selection label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.8rem;
  font-weight: 700;
  cursor: pointer;
}

.message-project-bulk-selection input {
  inline-size: 1rem;
  block-size: 1rem;
}

.message-project-bulk-selection span {
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.message-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.message-row.is-closed { opacity: 0.62; }
.message-row.is-unread {
  border-left: 3px solid #70b6ff;
  padding-left: calc(1rem - 3px);
  background: rgba(69, 139, 217, 0.1);
}
.message-row:last-child { border-bottom: 0; }
.message-main { min-width: 0; }

.message-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.55rem;
  color: var(--color-muted);
  font-size: 0.79rem;
}

.message-main p {
  margin: 0.38rem 0 0;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.message-read-state {
  color: #d7ecff;
  border: 1px solid rgba(112, 182, 255, 0.54);
  border-radius: 999px;
  padding: 0.06rem 0.4rem;
  font-weight: 700;
}

.message-row:not(.is-unread) .message-read-state {
  color: var(--color-muted);
  border-color: var(--color-border);
}

.message-read-toggle { white-space: nowrap; }

.table-action-timer-start {
  color: #e0ffe7;
  border-color: #3d9b61;
  background: #1f7042;
}

.table-action-timer-start:hover {
  color: #fff;
  border-color: #55be78;
  background: #2c8b52;
}

.table-action-timer-stop {
  color: #fff;
  border-color: #d57715;
  background: #b95b08;
}

.table-action-timer-stop:hover {
  color: #fff;
  border-color: #f3a13a;
  background: #a84f08;
}

.time-allocation,
.time-allocation-form,
.time-allocation-distribution {
  display: grid;
  width: 100%;
  gap: 1rem;
}

.time-allocation-form {
  margin: 0;
}

.time-allocation .panel-header {
  margin-bottom: 0;
}

.time-allocation-header {
  align-items: center;
}

.time-allocation-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.time-allocation-table th,
.time-allocation-table td {
  padding: 0.55rem 0.7rem;
  vertical-align: middle;
}

.time-allocation-table th:last-child,
.time-allocation-table td:last-child {
  width: 11.5rem;
  text-align: right;
}

.time-allocation-task-cell {
  line-height: 1.3;
}

.time-allocation-category {
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.time-allocation-task-cell strong {
  margin-left: 0.4rem;
}

.time-allocation-current-task {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.1rem 0.38rem;
  border-radius: 999px;
  color: var(--color-primary);
  background: var(--color-surface-soft);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.time-allocation-duration-cell {
  white-space: nowrap;
}

.time-allocation-table input {
  width: 9rem;
  min-width: 0;
  text-align: center;
}

.time-allocation-source {
  display: block;
  margin-top: 0.2rem;
  color: var(--color-muted);
  font-size: 0.78rem;
}

.time-allocation-source-minutes {
  display: block;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.time-allocation-table td small {
  display: block;
  margin-top: 0.2rem;
  color: var(--color-muted);
}

.time-allocation-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: baseline;
  margin-top: 0.8rem;
  color: var(--color-muted);
}

.time-allocation-summary span {
  color: var(--color-text);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.time-allocation-invalid .time-allocation-summary,
.time-allocation-invalid .time-allocation-summary span {
  color: var(--color-danger);
}

.time-allocation-invalid .time-allocation-input {
  border-color: var(--color-danger);
}

.time-allocation-locked {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: baseline;
  padding: 0.75rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--color-success) 38%, var(--color-border));
  border-radius: var(--radius);
  color: var(--color-muted);
  background: color-mix(in srgb, var(--color-success) 8%, var(--color-surface));
}

.time-allocation-locked strong {
  color: var(--color-text);
}

.time-allocation-note {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}

.time-allocation-note-header {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}

.time-allocation-note h3 {
  margin: 0;
}

.time-allocation-note h2 {
  margin: 0;
}

.time-allocation-note-header > div > p {
  margin: 0.25rem 0 0;
  color: var(--color-muted);
  font-size: 0.88rem;
}

.time-allocation-note-context {
  margin: 0;
  padding: 0.42rem 0.6rem;
  border-radius: 999px;
  color: var(--color-text);
  background: var(--color-surface-soft);
  font-size: 0.8rem;
}

.time-allocation-note-form,
.time-allocation-note-fields {
  display: grid;
  gap: 0.75rem;
}

.time-allocation-note-fields {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.time-allocation-note-fields .field:first-child {
  max-width: 24rem;
}

.time-allocation-note-form textarea {
  min-height: 88px;
}

.time-allocation-note input[type="file"] {
  width: fit-content;
  max-width: 100%;
  margin-top: 0.5rem;
  color: var(--color-muted);
  font-size: 0.83rem;
}

.time-allocation-note [data-note-image-status] {
  display: block;
  margin-top: 0.25rem;
}

.time-allocation-note-pending {
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
}

.time-allocation-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--color-border);
}

.time-allocation-confirmation {
  flex: 1 1 38rem;
  min-height: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--color-primary) 45%, var(--color-border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--color-primary) 9%, var(--color-surface));
  font-weight: 650;
}

.time-allocation-confirmation input {
  margin-top: 0.15rem;
}

.time-allocation-actions {
  flex: 0 0 auto;
  margin: 0;
}

@media (max-width: 720px) {
  .time-allocation-note-fields {
    grid-template-columns: 1fr;
  }

  .time-allocation-table th:last-child,
  .time-allocation-table td:last-child {
    width: auto;
    text-align: left;
  }

  .time-allocation-task-cell strong,
  .time-allocation-current-task {
    display: block;
    margin: 0.2rem 0 0;
  }

  .time-allocation-duration-cell {
    white-space: normal;
  }
}

.extra-estimate-panel {
  max-width: 52rem;
}

.estimate-review-values {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.estimate-review-values > div {
  display: grid;
  gap: 0.25rem;
  padding: 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-soft);
}

.estimate-review-values span {
  color: var(--color-muted);
  font-size: 0.82rem;
}

.estimate-review-values strong {
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.table-bulk-actions {
  justify-content: flex-end;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--color-border);
}

.table-bulk-actions .field {
  min-width: min(100%, 280px);
}

.project-revert-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.8rem;
}

.project-revert-form .field {
  flex: 1 1 260px;
}

.opn-conversion-responsibles {
  display: grid;
  grid-template-columns: repeat(2, minmax(15rem, 1fr));
  gap: 0.8rem;
  width: 100%;
  margin: 0;
  padding: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.opn-conversion-responsibles legend {
  padding: 0 0.35rem;
  color: var(--color-text);
  font-weight: 800;
}

.opn-conversion-responsibles > p,
.opn-conversion-responsibles > .alert,
.opn-conversion-responsibles > .form-actions {
  grid-column: 1 / -1;
  margin: 0;
}

.opn-conversion-responsibles .field {
  min-width: 0;
}

.opn-conversion-email-note {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: inherit;
  gap: 0.8rem;
  margin: 0;
  padding: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.opn-conversion-email-note legend {
  padding: 0 0.35rem;
  color: var(--color-text);
  font-weight: 800;
}

.opn-conversion-email-note > p,
.opn-conversion-email-note > .field,
.opn-conversion-email-note > .form-actions {
  grid-column: 1 / -1;
  margin: 0;
}

.opn-conversion-email-note textarea {
  min-height: 7rem;
}

.opn-conversion-email-note[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .opn-conversion-responsibles {
    grid-template-columns: 1fr;
  }
}

.table-scroll {
  overflow: visible;
}

.data-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: normal;
}

.data-table th {
  color: var(--color-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.table-sort {
  display: inline-flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.table-sort:hover {
  color: var(--color-primary-strong);
}

.table-sort-icon {
  flex: 0 0 auto;
  color: var(--color-primary-strong);
  font-size: 1rem;
  line-height: 0.82;
}

.table-actions-column,
.table-row-actions {
  width: 112px;
}

.data-table.action-column-nowrap .table-actions-column,
.data-table.action-column-nowrap .table-row-actions {
  width: 168px;
  white-space: nowrap;
}

.data-table.action-column-nowrap .action-row {
  flex-wrap: nowrap;
}

.data-table.directory-customer-table td:not(.table-row-actions) {
  max-width: 265px;
  overflow: hidden;
  white-space: normal;
}

.data-table.directory-customer-table .customer-list-cell {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.project-expand-column {
  width: 46px;
}

.table-action-icon {
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  font-size: 0.78rem;
}

/* Reusable action language: the compact square geometry follows the project
   list quick actions and is shared by every operational icon in the CRM. */
.table-action-icon {
  display: inline-grid;
  place-items: center;
  border: 1px solid #394b61;
  border-radius: 6px;
  background: var(--color-surface-soft);
  color: var(--color-text);
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.table-action-icon:hover,
.table-action-icon:focus-visible {
  border-color: var(--color-primary-strong);
  color: #111c2b;
  background: var(--color-primary-strong);
  transform: translateY(-1px);
}

/* Final common contract for compact controls. Project and planning shortcuts
   deliberately use the same component as table/report actions, so size,
   hit-area, focus feedback and disabled state cannot drift between modules. */
.icon-button,
.table-action-icon,
.project-row-priority-actions > a,
.project-row-priority-actions > button,
.project-quick-actions > a:not(.balance-opn-action),
.project-quick-actions > button,
.project-provider-action {
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.icon-button:disabled,
.table-action-icon:disabled,
.project-row-priority-actions > button:disabled,
.project-quick-actions > button:disabled,
.icon-button[aria-busy="true"],
.table-action-icon[aria-busy="true"],
.project-row-priority-actions > button[aria-busy="true"],
.project-quick-actions > button[aria-busy="true"] {
  cursor: wait;
  opacity: 0.58;
  transform: none;
}

body.theme-contrast .icon-button,
body.theme-contrast .table-action-icon,
body.theme-contrast .project-row-priority-actions > a,
body.theme-contrast .project-row-priority-actions > button,
body.theme-contrast .project-quick-actions > a,
body.theme-contrast .project-quick-actions > button,
body.theme-contrast .project-provider-action {
  border-width: 2px;
  text-decoration: none;
}

.table-action-danger.table-action-icon,
.table-action-timer-stop.table-action-icon {
  border-color: var(--color-danger);
  color: var(--color-danger);
  background: var(--color-surface-soft);
}

.table-action-timer-start.table-action-icon,
.table-action-validate.table-action-icon {
  border-color: var(--color-success);
  color: var(--color-success);
  background: var(--color-surface-soft);
}

.table-action-danger.table-action-icon:hover,
.table-action-danger.table-action-icon:focus-visible,
.table-action-timer-stop.table-action-icon:hover,
.table-action-timer-stop.table-action-icon:focus-visible {
  border-color: var(--color-danger);
  color: #fff;
  background: var(--color-danger);
}

.table-action-timer-start.table-action-icon:hover,
.table-action-timer-start.table-action-icon:focus-visible,
.table-action-validate.table-action-icon:hover,
.table-action-validate.table-action-icon:focus-visible {
  border-color: var(--color-success);
  color: #fff;
  background: var(--color-success);
}

.external-task-date-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.external-task-date-editor > [data-external-task-date-value] {
  min-width: 5.9rem;
}

.external-task-date-editor .external-task-date-edit,
.external-task-date-editor .external-task-date-cancel,
.external-task-date-editor .table-action-validate {
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  font-size: 0.78rem;
}

.external-task-date-form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.external-task-date-form[hidden] {
  display: none;
}

.external-task-date-form input[type="date"] {
  width: 9.2rem;
  min-width: 0;
}

.external-task-date-status {
  flex-basis: 100%;
  color: var(--color-success);
  font-size: 0.75rem;
}

.external-task-date-status.is-error {
  color: var(--color-danger);
}

@media (max-width: 1100px) {
  .customer-merge-list-head {
    display: none;
  }

  .customer-merge-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-merge-row [role="cell"]::before {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--color-muted);
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .customer-merge-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .user-edit-identity { padding: 0.8rem; }
  .user-edit-avatar { width: 4rem; height: 4rem; }
  .profile-avatar-form,
  .customer-duplicate-item,
  .customer-merge-summary,
  .customer-merge-selection,
  .customer-merge-row {
    grid-template-columns: 1fr;
  }

  .customer-merge-selection-status,
  .customer-merge-row-actions {
    grid-column: auto;
  }

  .customer-duplicate-item span:nth-of-type(2),
  .customer-duplicate-item .button {
    grid-column: auto;
    grid-row: auto;
  }
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.estimate-panel {
  margin-bottom: 1rem;
}

.estimate-category-picker {
  margin: 0 0 1rem;
  padding: 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}

.estimate-category-picker summary {
  color: var(--color-primary-strong);
  font-weight: 800;
  cursor: pointer;
}

.estimate-category-picker p {
  color: var(--color-muted);
}

.estimate-category-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.estimate-table {
  min-width: 0;
}

.estimate-table th,
.estimate-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.estimate-table td:nth-child(2),
.estimate-table td:nth-child(15) {
  white-space: normal;
  min-width: 0;
}

.estimate-article-picker,
.estimate-category-picker {
  margin: 0 0 0.85rem;
}

.estimate-article-picker summary,
.estimate-category-picker summary,
.project-more-details summary {
  cursor: pointer;
  color: var(--color-text);
  font-weight: 800;
}

.estimate-article-picker p,
.estimate-category-picker p {
  margin: 0.6rem 0;
  color: var(--color-muted);
}

.estimate-article-picker select {
  min-height: 13rem;
}

.estimate-bulk-form {
  margin: 0;
}

.estimate-edit-input {
  width: 100%;
  min-width: 0;
  padding: 0.38rem 0.42rem;
  font-size: 0.84rem;
}

.estimate-edit-input:not(.is-editing):not([type="hidden"]) {
  padding-inline: 0;
  border-color: transparent;
  background: transparent;
  color: inherit;
  box-shadow: none;
  pointer-events: none;
}

.estimate-table td:has(.estimate-edit-input:not(.is-editing):not([type="hidden"])) {
  cursor: pointer;
}

.estimate-edit-input.is-editing {
  background: var(--color-surface-elevated);
  outline: 2px solid color-mix(in srgb, var(--color-primary) 45%, transparent);
}

.estimate-line-saving {
  opacity: 0.7;
}

.estimate-save-status {
  margin: 0.7rem 0 0;
  color: var(--color-muted);
  font-size: 0.88rem;
}

.estimate-save-status.estimate-save-success {
  color: #bcf1d3;
}

.estimate-save-status.estimate-save-error {
  color: #ffd3d3;
}

.estimate-duration-input {
  text-align: right;
}

.estimate-provider-margin {
  display: grid;
  gap: 0.22rem;
  color: var(--color-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.estimate-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--color-border);
}

.estimate-bulk-actions p {
  margin: 0;
  color: var(--color-muted);
}

.estimate-provider-row {
  background: rgba(245, 185, 71, 0.08);
}

.estimate-line-total {
  color: var(--color-primary-strong);
  font-weight: 800;
}

.margin-positive,
.margin-healthy {
  color: #bcf1d3;
  font-weight: 800;
}

.margin-warning {
  color: #ffe1a3;
  font-weight: 800;
}

.margin-danger {
  color: #ffd3d3;
  font-weight: 800;
}

.margin-neutral {
  color: #fff;
  font-weight: 800;
}

.project-tasks-table > thead > tr > th,
.project-tasks-table > tbody > .project-task-content-row > td {
  white-space: normal;
  vertical-align: middle;
}

.project-tasks-table > thead > tr > th:first-child,
.project-tasks-table > tbody > .project-task-content-row > td:first-child {
  width: 24%;
}

.project-tasks-table > thead > tr > th:nth-child(2),
.project-tasks-table > tbody > .project-task-content-row > td:nth-child(2) {
  width: 11%;
}

.project-tasks-table > thead > tr > th:nth-child(3),
.project-tasks-table > tbody > .project-task-content-row > td:nth-child(3) {
  width: 16%;
}

.project-tasks-table > thead > tr > th:last-child,
.project-tasks-table > tbody > .project-task-content-row > td:last-child {
  width: 7.75rem;
}

.project-tasks-table .project-task-name {
  min-width: 0;
}

.project-tasks-table .project-task-actions {
  flex-wrap: wrap;
  gap: 0.22rem;
}

.directory-one-line-table th,
.directory-one-line-table td {
  white-space: nowrap;
}

/* The users list contains both identity and personnel-cost data.  It needs a
   stable, wider desktop grid instead of inheriting the one-line directory
   layout: long headings stay readable and the table scrolls as one unit only
   when the work area cannot accommodate every column. */
.users-table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.data-table.users-directory-table {
  min-width: 64rem;
  table-layout: fixed;
}

.users-directory-actions-column { width: 7.75rem; }
.users-directory-name-column { width: 12.5%; }
.users-directory-email-column { width: 16.5%; }
.users-directory-level-column { width: 8.5%; }
.users-directory-is_active-column { width: 6.5%; }
.users-directory-baseMonthlySalary-column { width: 13%; }
.users-directory-annualMealAllowance-column { width: 14%; }
.users-directory-indicativeHourlyCost-column { width: 11%; }
.users-directory-initials-column { width: 8%; }

.data-table.users-directory-table th,
.data-table.users-directory-table td {
  white-space: normal;
  vertical-align: middle;
}

.data-table.users-directory-table .table-actions-column,
.data-table.users-directory-table .table-row-actions {
  width: 7.75rem;
}

.data-table.users-directory-table .action-row {
  flex-wrap: nowrap;
  gap: 0.35rem;
}

.users-directory-table .table-sort {
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.3rem;
  line-height: 1.25;
}

.users-directory-table .table-sort-label {
  min-width: 0;
}

.users-directory-table .table-sort-icon {
  margin-top: 0.08rem;
}

.users-directory-table .table-actions-column,
.users-directory-table th[data-column="name"],
.users-directory-table th[data-column="email"],
.users-directory-table th[data-column="level"],
.users-directory-table th[data-column="is_active"],
.users-directory-table th[data-column="initials"] {
  text-align: left;
}

.users-directory-table th[data-column="baseMonthlySalary"],
.users-directory-table th[data-column="annualMealAllowance"],
.users-directory-table th[data-column="indicativeHourlyCost"] {
  text-align: right;
}

.users-directory-table th[data-column="baseMonthlySalary"] .table-sort,
.users-directory-table th[data-column="annualMealAllowance"] .table-sort,
.users-directory-table th[data-column="indicativeHourlyCost"] .table-sort {
  justify-content: flex-end;
}

.users-directory-table th[data-column="baseMonthlySalary"] .table-sort-label,
.users-directory-table th[data-column="annualMealAllowance"] .table-sort-label,
.users-directory-table th[data-column="indicativeHourlyCost"] .table-sort-label {
  text-align: right;
}

.users-directory-table [data-column="baseMonthlySalary"],
.users-directory-table [data-column="annualMealAllowance"],
.users-directory-table [data-column="indicativeHourlyCost"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.project-task-list-two-lines {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.estimate-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.estimate-summary div {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}

.estimate-summary span {
  color: var(--color-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.estimate-summary strong {
  overflow-wrap: anywhere;
}

.empty-cell {
  color: var(--color-muted);
  text-align: center;
}

.module-roadmap {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.module-roadmap article {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}

.module-roadmap span {
  color: var(--color-muted);
}

.scheduled-updates-hero,
.scheduled-updates-intro,
.scheduled-updates-create,
.scheduled-updates-list,
.scheduled-updates-history,
.scheduled-updates-runner,
.scheduled-updates-unavailable {
  margin-bottom: 1rem;
}

.scheduled-updates-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.scheduled-updates-intro h3 { margin: 0; }
.scheduled-updates-intro p { margin: .3rem 0 0; color: var(--color-muted); }
.scheduled-updates-runner p { margin: 0; color: var(--color-muted); }

.scheduled-updates-form {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(8rem, .45fr) minmax(14rem, .8fr) auto;
  align-items: end;
  gap: .8rem;
}

.scheduled-updates-form .field,
.scheduled-updates-form .form-actions { margin: 0; }

.scheduled-update-toggle {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  min-height: 42px;
  padding: .55rem .65rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  cursor: pointer;
}

.scheduled-update-toggle input { margin-top: .18rem; }
.scheduled-update-toggle span { display: grid; gap: .1rem; }
.scheduled-update-toggle small { color: var(--color-muted); }

.scheduled-updates-list { overflow: visible; }
.scheduled-updates-list-grid { display: grid; gap: .7rem; }
.scheduled-update-card {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(5rem, .5fr) minmax(6rem, .6fr) minmax(9rem, .9fr) auto;
  align-items: center;
  gap: .75rem;
  padding: .8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}

.scheduled-update-card.is-read-only { grid-template-columns: minmax(0, 1.6fr) minmax(5rem, .5fr) minmax(6rem, .6fr) minmax(9rem, .9fr); }
.scheduled-update-field { display: grid; min-width: 0; gap: .25rem; }
.scheduled-update-field > span:first-child { color: var(--color-muted); font-size: .72rem; font-weight: 750; letter-spacing: .02em; text-transform: uppercase; }
.scheduled-update-field > strong { overflow-wrap: anywhere; }
.scheduled-updates-history-scroll { overflow: auto; }
.scheduled-updates-history-table { min-width: 76rem; }

.scheduled-update-actions {
  display: flex;
  justify-self: end;
  align-items: end;
}

.scheduled-update-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.scheduled-update-actions .table-action-form { display: block; margin: 0; }
.scheduled-update-action-icon {
  width: 2.25rem;
  min-width: 2.25rem;
  height: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  font-size: 1rem;
}

.scheduled-update-edit { position: relative; }
.scheduled-update-edit > summary { list-style: none; cursor: pointer; }
.scheduled-update-edit > summary::-webkit-details-marker { display: none; }
.scheduled-update-edit form {
  position: absolute;
  z-index: 5;
  top: calc(100% + .35rem);
  right: 0;
  left: auto;
  display: grid;
  gap: .55rem;
  width: min(20rem, calc(100vw - 2rem));
  box-sizing: border-box;
  padding: .75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  box-shadow: 0 .75rem 1.8rem rgba(15, 23, 42, .22);
}

.scheduled-update-edit .scheduled-update-toggle { min-height: 0; padding: .4rem .5rem; }
body.theme-contrast .scheduled-update-card,
body.theme-contrast .scheduled-update-edit form { border-width: 2px; border-color: var(--color-text); }
body.theme-contrast .scheduled-update-action-icon { border-width: 2px; }
.scheduled-update-active,
.scheduled-run-status-completed { color: #067647; background: rgba(18, 183, 106, .1); border-color: rgba(18, 183, 106, .35); }
.scheduled-update-inactive,
.scheduled-run-status-running { color: #8a4d00; background: rgba(244, 124, 32, .12); border-color: rgba(244, 124, 32, .35); }
.scheduled-run-status-error { color: #b42318; background: rgba(217, 45, 32, .1); border-color: rgba(217, 45, 32, .35); }
.scheduled-run-status-queued,
.scheduled-run-status-completed_with_warnings { color: #8a4d00; background: rgba(244, 124, 32, .12); border-color: rgba(244, 124, 32, .35); }

form[data-scheduled-update] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.workflow-form[data-scheduled-update] { margin-top: 1rem; }

.scheduled-update-status {
  flex: 1 0 100%;
  margin: 0;
  color: var(--color-muted);
  font-size: .875rem;
  line-height: 1.4;
}

.scheduled-update-status.is-scheduled,
.scheduled-update-status.is-queued,
.scheduled-update-status.is-running { color: #8a4d00; }
.scheduled-update-status.is-completed { color: #067647; }
.scheduled-update-status.is-completed_with_warnings { color: #8a4d00; }
.scheduled-update-status.is-error { color: #b42318; }

.scheduled-update-toast {
  position: fixed;
  z-index: 140;
  right: 1rem;
  bottom: 1rem;
  width: min(25rem, calc(100vw - 2rem));
  padding: .8rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  box-shadow: 0 .75rem 1.8rem rgba(15, 23, 42, .22);
  color: var(--color-text);
  font-size: .9rem;
  line-height: 1.4;
}

.scheduled-update-toast.is-scheduled,
.scheduled-update-toast.is-queued,
.scheduled-update-toast.is-running,
.scheduled-update-toast.is-completed_with_warnings { border-color: rgba(244, 124, 32, .45); }
.scheduled-update-toast.is-completed { border-color: rgba(18, 183, 106, .45); }
.scheduled-update-toast.is-error { border-color: rgba(217, 45, 32, .5); }

@media (max-width: 900px) {
  .scheduled-updates-intro { align-items: flex-start; flex-direction: column; }
  .scheduled-updates-form { grid-template-columns: 1fr 1fr; }
  .scheduled-updates-form .form-actions { grid-column: 1 / -1; }
  .scheduled-update-card,
  .scheduled-update-card.is-read-only { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scheduled-update-actions { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 560px) {
  .scheduled-updates-form { grid-template-columns: 1fr; }
  .scheduled-updates-form .form-actions { grid-column: auto; }
  .scheduled-update-card,
  .scheduled-update-card.is-read-only { grid-template-columns: minmax(0, 1fr); }
  .scheduled-update-edit form { position: static; width: 100%; margin-top: .55rem; }
}

.performance-policy-hero {
  margin-bottom: 1rem;
}

.performance-policy-form {
  display: grid;
  gap: 1rem;
}

.performance-policy-section {
  display: grid;
  gap: 1rem;
}

.performance-policy-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.performance-policy-metric-table .field {
  display: flex;
  min-width: 9rem;
  align-items: center;
  gap: 0.4rem;
}

.performance-policy-metric-table .field input {
  min-width: 0;
}

.performance-policy-metric-table .field span,
.performance-policy-inherited {
  color: var(--color-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.performance-policy-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.65rem;
  color: var(--color-text);
}

.performance-policy-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-primary);
}

.performance-policy-seniority {
  display: grid;
  gap: 0.65rem;
}

.performance-policy-apply {
  display: grid;
  gap: 0.85rem;
}

.performance-policy-apply h3,
.performance-policy-apply p {
  margin: 0;
}

.performance-policy-apply ul {
  margin: 0.45rem 0 0;
  padding-left: 1.2rem;
  color: var(--color-muted);
}

.performance-policy-annual-results {
  margin-top: 1rem;
}

.module-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.2rem;
  background:
    linear-gradient(135deg, rgba(244, 124, 32, 0.16), rgba(197, 207, 221, 0.06) 42%, rgba(16, 26, 39, 0.96)),
    var(--color-surface);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.module-hero h2 {
  margin: 0.18rem 0 0;
  font-size: 1.65rem;
  line-height: 1.15;
}

.module-hero p {
  margin: 0.35rem 0 0;
  color: var(--color-muted);
}

.module-hero-stats,
.quick-module-grid,
.module-card-grid {
  display: grid;
  gap: 0.75rem;
}

.module-hero-stats {
  grid-template-columns: repeat(2, auto);
}

.module-hero-stats strong {
  margin-right: 0.2rem;
  color: var(--color-text);
}

.quick-module-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.quick-module,
.module-card {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.quick-module {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.52rem;
  min-height: 76px;
  padding: 0.75rem;
  color: var(--color-text);
}

.quick-module:hover,
.module-card:hover {
  color: var(--color-text);
  border-color: rgba(244, 124, 32, 0.55);
  background: #1a293d;
  transform: translateY(-2px);
}

.quick-module strong,
.module-card strong {
  min-width: 0;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.quick-module small {
  grid-column: 2;
  width: fit-content;
  color: var(--color-primary-strong);
}

.module-hub {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.module-group {
  display: grid;
  gap: 0.75rem;
}

.module-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--color-border);
  padding: 0.2rem 0 0.65rem;
}

.module-group-header h2 {
  margin: 0;
  font-size: 1.08rem;
}

.module-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.module-card-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  gap: 0.38rem 0.65rem;
  min-height: 138px;
  padding: 0.9rem;
  color: var(--color-text);
}

.module-card > .nav-icon {
  grid-row: span 3;
  margin-top: 0.1rem;
}

.module-card span:not(.nav-icon) {
  min-width: 0;
  color: var(--color-muted);
  overflow-wrap: anywhere;
}

.module-card small {
  width: fit-content;
  color: #f6c682;
  background: rgba(244, 124, 32, 0.1);
  border-color: rgba(244, 124, 32, 0.24);
}

.module-card-static:hover {
  border-color: var(--color-border);
  background: var(--color-surface-elevated);
  transform: none;
}

.app-footer {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 1rem 1.25rem 1.5rem;
  color: var(--color-muted);
  font-size: 0.88rem;
}

.footer-project-card {
  display: grid;
  gap: 0.34rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(244, 124, 32, 0.26);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius);
  background: linear-gradient(110deg, rgba(244, 124, 32, 0.1), var(--color-surface-elevated));
}

.footer-project-card blockquote {
  margin: 0;
  color: var(--color-text);
  font-size: 0.84rem;
  font-style: normal;
  line-height: 1.45;
}

.footer-project-card cite {
  color: var(--color-primary-strong);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 750;
}

.legal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.7rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.8rem;
}

.legal-row span:not(:last-child)::after {
  content: "|";
  margin-left: 0.7rem;
  color: #536276;
}

.planning-hero,
.planning-hero-actions,
.planning-project-header,
.planning-project-actions,
.planning-project-overview,
.planning-project-edit-grid,
.planning-insights-grid,
.planning-summary-grid {
  display: grid;
  gap: 1rem;
}

.planning-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.planning-hero h1 {
  margin: 0.08rem 0 0;
  font-size: 1.45rem;
}

.planning-hero p:not(.eyebrow) {
  margin: 0.2rem 0 0;
  color: var(--color-muted);
}

.planning-hero-actions {
  grid-auto-flow: column;
  align-items: center;
}

.planning-filter-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 0.75rem;
}

.planning-filter-form .field {
  min-width: 0;
}

.planning-delayed-filter {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 0.55rem;
  color: var(--color-muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.planning-delayed-filter input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.planning-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.planning-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.planning-insights-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  margin-bottom: 1rem;
}

.planning-folder-list {
  display: grid;
  gap: 0.7rem;
}

.planning-columns-panel {
  margin-bottom: 1rem;
}

.planning-columns-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}

.planning-columns-panel > summary::-webkit-details-marker { display: none; }
.planning-columns-panel > summary > span:first-child { display: grid; gap: .16rem; }
.planning-columns-panel summary small { color: var(--color-muted); font-size: .78rem; font-weight: 500; }
.planning-columns-count { flex: 0 0 auto; padding: .26rem .5rem; border-radius: 999px; color: var(--color-primary-strong); background: var(--color-primary-soft); font-size: .76rem; font-weight: 800; }
.planning-columns-form { display: grid; gap: .8rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--color-border); }
.planning-columns-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .48rem .8rem; }
.planning-columns-list label { display: inline-flex; align-items: center; min-width: 0; gap: .42rem; color: var(--color-text); font-size: .82rem; }
.planning-columns-list input { width: auto; min-height: auto; margin: 0; accent-color: var(--color-primary); }
.planning-column-hidden { display: none !important; }

.planning-folder-chart { display: grid; grid-template-columns: 5.25rem minmax(0, 1fr); grid-template-rows: 1fr 1fr; column-gap: .65rem; align-items: end; margin: .1rem 0 .8rem; }
.planning-folder-chart svg { grid-row: 1 / span 2; width: 5.25rem; height: 5.25rem; transform: rotate(-90deg); }
.planning-folder-chart circle { fill: none; stroke-width: 5; }
.planning-folder-chart strong { align-self: end; }
.planning-folder-chart span { align-self: start; color: var(--color-muted); font-size: .78rem; }
.planning-folder-segment-0, .planning-folder-key-0 { stroke: #e48238; background: #e48238; }
.planning-folder-segment-1, .planning-folder-key-1 { stroke: #4c9dcb; background: #4c9dcb; }
.planning-folder-segment-2, .planning-folder-key-2 { stroke: #749f70; background: #749f70; }
.planning-folder-segment-3, .planning-folder-key-3 { stroke: #b88d55; background: #b88d55; }
.planning-folder-segment-4, .planning-folder-key-4 { stroke: #9b79c7; background: #9b79c7; }
.planning-folder-segment-5, .planning-folder-key-5 { stroke: #d16f88; background: #d16f88; }

.planning-folder-row {
  display: grid;
  grid-template-columns: minmax(8rem, 0.8fr) minmax(7rem, 2fr) 2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  font-size: 0.88rem;
}

.planning-folder-row > span {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  overflow-wrap: anywhere;
}

.planning-folder-key { width: .58rem; height: .58rem; flex: 0 0 auto; border-radius: 50%; }

.planning-folder-row > div {
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-surface-soft);
}

.planning-folder-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-strong));
}

.planning-folder-row strong {
  text-align: right;
}

.planning-folder-row small { overflow: hidden; color: var(--color-muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.planning-folder-progress-1 { width: 5%; }.planning-folder-progress-2 { width: 10%; }.planning-folder-progress-3 { width: 15%; }.planning-folder-progress-4 { width: 20%; }.planning-folder-progress-5 { width: 25%; }.planning-folder-progress-6 { width: 30%; }.planning-folder-progress-7 { width: 35%; }.planning-folder-progress-8 { width: 40%; }.planning-folder-progress-9 { width: 45%; }.planning-folder-progress-10 { width: 50%; }.planning-folder-progress-11 { width: 55%; }.planning-folder-progress-12 { width: 60%; }.planning-folder-progress-13 { width: 65%; }.planning-folder-progress-14 { width: 70%; }.planning-folder-progress-15 { width: 75%; }.planning-folder-progress-16 { width: 80%; }.planning-folder-progress-17 { width: 85%; }.planning-folder-progress-18 { width: 90%; }.planning-folder-progress-19 { width: 95%; }.planning-folder-progress-20 { width: 100%; }

/* Technician competencies */
.competency-hero,
.competency-management-grid,
.competency-bottom-grid,
.competency-filter-form,
.competency-form,
.competency-technician-grid {
  display: grid;
  gap: 1rem;
}

.competency-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 1rem;
}

.competency-hero h1 { margin: .1rem 0 .3rem; }
.competency-hero p:not(.eyebrow) { margin: 0; color: var(--color-muted); }

.competency-hero-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: .5rem;
}

.competency-hero-metrics span,
.competency-level {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: .2rem .55rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  background: var(--color-surface-soft);
  font-size: .76rem;
  font-weight: 800;
}

.competency-hero-metrics strong { margin-right: .25rem; color: var(--color-primary-strong); font-size: .96rem; }

.competency-filter-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}

.competency-filter-actions { display: flex; flex-wrap: wrap; gap: .55rem; }

.competency-management-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  margin-bottom: 1rem;
}

.competency-form-panel { min-width: 0; }

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

.competency-assignment-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.competency-assignment-form > .field:nth-of-type(5),
.competency-assignment-form > .field:nth-of-type(6),
.competency-assignment-form > button { grid-column: 1 / -1; }

.competency-requirement-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.competency-requirement-form > button { grid-column: 1 / -1; justify-self: start; }

.competency-technicians-panel,
.competency-assignment-panel { margin-bottom: 1rem; }

.competency-technician-grid {
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.competency-technician-card {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  min-width: 0;
  padding: .7rem;
  border: 1px solid var(--color-border);
  border-radius: .6rem;
  color: var(--color-text);
  background: var(--color-surface-soft);
}

.competency-technician-card:hover { border-color: var(--color-primary); background: var(--color-primary-soft); }
.competency-technician-card strong,
.competency-technician-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.competency-technician-card small { margin-top: .12rem; color: var(--color-muted); font-size: .74rem; }

.competency-technician-initials {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 50%;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  font-size: .76rem;
  font-weight: 900;
}

.competency-assignment-table td small { display: block; margin-top: .18rem; color: var(--color-muted); font-size: .72rem; }
.competency-level-basic { color: #cfe1f8; border-color: rgba(86, 137, 193, .55); }
.competency-level-intermediate { color: #d7efca; border-color: rgba(102, 158, 83, .55); }
.competency-level-advanced { color: #ffe3a4; border-color: rgba(200, 150, 71, .6); }
.competency-level-expert { color: #ffd0e6; border-color: rgba(187, 88, 142, .6); }

.competency-edit-details { min-width: 8.5rem; }
.competency-edit-details > summary { display: inline-flex; align-items: center; cursor: pointer; list-style: none; }
.competency-edit-details > summary::-webkit-details-marker { display: none; }
.competency-inline-form { display: grid; gap: .45rem; min-width: 14rem; margin-top: .45rem; padding: .6rem; border: 1px solid var(--color-border); border-radius: .5rem; background: var(--color-surface); }
.competency-inline-form input,
.competency-inline-form select,
.competency-inline-form textarea { min-width: 0; }
.competency-inline-form textarea { resize: vertical; }

.competency-bottom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 1rem; }
.competency-requirement-list,
.competency-history-list { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.competency-requirement-list li { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--color-border); }
.competency-requirement-list li:last-child { border-bottom: 0; }
.competency-requirement-list span,
.competency-history-list li { display: grid; gap: .12rem; }
.competency-requirement-list small,
.competency-history-list span { color: var(--color-muted); font-size: .76rem; }

@media (max-width: 1120px) {
  .competency-management-grid { grid-template-columns: 1fr 1fr; }
  .competency-management-grid > :last-child { grid-column: 1 / -1; }
  .competency-filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .competency-hero,
  .competency-management-grid,
  .competency-bottom-grid,
  .competency-filter-form,
  .competency-assignment-form,
  .competency-requirement-form { grid-template-columns: minmax(0, 1fr); }
  .competency-hero-metrics { justify-content: start; }
  .competency-management-grid > :last-child { grid-column: auto; }
  .competency-assignment-form > .field:nth-of-type(5),
  .competency-assignment-form > .field:nth-of-type(6),
  .competency-assignment-form > button,
  .competency-requirement-form > button { grid-column: auto; }
}

/* Competencies declared directly against the task catalogue. */
.user-competency-link {
  color: var(--color-primary-strong);
  font-weight: 800;
  text-decoration: none;
}

.user-competency-link:hover { text-decoration: underline; }

.user-task-competency-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.user-task-competency-hero h1 { margin: .1rem 0 .35rem; }
.user-task-competency-hero p:not(.eyebrow) { max-width: 54rem; margin: 0; color: var(--color-muted); }

.user-task-competency-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: .5rem;
}

.user-task-competency-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: .22rem .6rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  background: var(--color-surface-soft);
  font-size: .75rem;
  font-weight: 800;
}

.user-task-competency-summary strong { margin-right: .28rem; color: var(--color-primary-strong); font-size: .96rem; }
.user-task-competency-back { margin: 0 0 1rem; }
.user-task-competency-panel { margin-bottom: 1rem; }

.user-task-competency-initials {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 50%;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  font-size: .8rem;
  font-weight: 900;
}

.user-task-competency-categories { display: grid; gap: .65rem; }

.user-task-competency-category {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: .65rem;
  background: var(--color-surface-soft);
}

.user-task-competency-category > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 3.2rem;
  padding: .75rem .9rem;
  cursor: pointer;
  list-style: none;
  font-weight: 850;
}

.user-task-competency-category > summary::-webkit-details-marker { display: none; }
.user-task-competency-category > summary::before { content: '›'; margin-right: .1rem; color: var(--color-primary-strong); font-size: 1.25rem; line-height: 1; transition: transform .16s ease; }
.user-task-competency-category[open] > summary::before { transform: rotate(90deg); }
.user-task-competency-category > summary > span { margin-right: auto; }
.user-task-competency-category > summary small { color: var(--color-muted); font-size: .75rem; font-weight: 750; text-align: right; }

.user-task-competency-list { display: grid; border-top: 1px solid var(--color-border); }

.user-task-competency-item {
  display: grid;
  grid-template-columns: 1.15rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .72rem;
  min-height: 3.7rem;
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}

.user-task-competency-item:last-child { border-bottom: 0; }
.user-task-competency-item:hover { background: rgba(255, 255, 255, .025); }
.user-task-competency-item.is-indicated { box-shadow: inset 3px 0 0 var(--color-primary); }
.user-task-competency-item.is-pending { box-shadow: inset 3px 0 0 #d8a54e; }
.user-task-competency-item input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--color-primary); }
.user-task-competency-checkbox-placeholder { width: 1rem; height: 1rem; border: 1px solid var(--color-border); border-radius: .2rem; opacity: .65; }

.user-task-competency-task { display: grid; gap: .13rem; min-width: 0; }
.user-task-competency-task strong { overflow-wrap: anywhere; }
.user-task-competency-task small,
.user-task-competency-empty { margin: 0; color: var(--color-muted); font-size: .76rem; }
.user-task-competency-empty { padding: .8rem .9rem; }

.user-task-competency-status {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: .08rem .48rem;
  border-radius: 999px;
  color: var(--color-muted);
  background: rgba(132, 146, 166, .12);
  font-size: .7rem;
  font-weight: 800;
  white-space: nowrap;
}

.user-task-competency-status.status-suspended,
.user-task-competency-status.status-finished { color: inherit; }
.user-task-competency-status.status-suspended { color: #ffe2a0; }
.user-task-competency-status.status-finished { color: #c2f3d8; }
.user-task-competency-actions { display: flex; justify-content: end; margin-top: 1rem; }

@media (max-width: 760px) {
  .user-task-competency-hero { grid-template-columns: minmax(0, 1fr); }
  .user-task-competency-summary { justify-content: start; }
  .user-task-competency-category > summary { align-items: start; }
  .user-task-competency-item { grid-template-columns: 1.15rem minmax(0, 1fr); }
  .user-task-competency-status { grid-column: 2; justify-self: start; }
  .user-task-competency-actions { justify-content: stretch; }
  .user-task-competency-actions .button { width: 100%; }
}

.planning-manager-table td:last-child {
  color: var(--color-primary-strong);
}

.planning-projects-panel {
  padding: 0;
  overflow: hidden;
}

.planning-projects-panel > .panel-header {
  padding: 1rem;
  margin: 0;
  border-bottom: 1px solid var(--color-border);
}

.planning-project-list {
  display: grid;
}

.planning-project-card {
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
}

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

.planning-project-card.is-delayed {
  box-shadow: inset 4px 0 0 var(--color-danger);
}

.planning-project-card.is-suspended {
  opacity: 0.76;
}

.planning-project-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.planning-project-header p {
  margin: 0.32rem 0 0;
  color: var(--color-muted);
  font-size: 0.86rem;
}

.planning-project-reference {
  display: inline-block;
  margin-right: 0.55rem;
  color: var(--color-text);
  font-size: 1.05rem;
  font-weight: 850;
}

.planning-project-reference:hover {
  color: var(--color-primary-strong);
}

.planning-project-status {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.08rem 0.48rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.status-active {
  color: #cbe6ff;
  background: rgba(83, 122, 155, 0.22);
}

.status-delayed {
  color: #ffd1d1;
  background: rgba(255, 102, 102, 0.16);
}

.status-suspended {
  color: #ffe2a0;
  background: rgba(245, 185, 71, 0.16);
}

.status-finished {
  color: #c2f3d8;
  background: rgba(59, 184, 120, 0.16);
}

.planning-project-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.22rem;
}

.planning-project-actions a {
  text-decoration: none;
}

.planning-project-overview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0.85rem 0;
}

.planning-project-overview > div {
  min-width: 0;
  padding: 0.65rem 0.72rem;
  border: 1px solid var(--color-border);
  border-radius: 0.55rem;
  background: rgba(21, 33, 50, 0.7);
}

.planning-project-overview span {
  display: block;
  margin-bottom: 0.14rem;
  color: var(--color-muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.planning-project-overview strong {
  display: block;
  font-size: 0.82rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.planning-project-overview em {
  font-style: normal;
}

.planning-danger {
  color: #ffb7b7;
}

.planning-warning {
  color: #ffe2a0;
}

.planning-success {
  color: var(--color-success);
}

.planning-project-edit-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 0.75rem;
}

.planning-edit-field {
  padding: 0.55rem 0.6rem;
}

.planning-edit-field .project-inline-value {
  cursor: pointer;
}

.planning-edit-field .project-inline-value:hover {
  color: var(--color-primary-strong);
}

.planning-team-details,
.planning-provider-details {
  margin-top: 0.55rem;
  border: 1px solid var(--color-border);
  border-radius: 0.6rem;
}

.planning-team-details {
  border-color: var(--planning-team-panel-border);
  background: var(--planning-team-panel);
}

.planning-provider-details {
  border-color: var(--planning-provider-panel-border);
  background: var(--planning-provider-panel);
}

.planning-team-details > summary,
.planning-provider-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.68rem 0.78rem;
  cursor: pointer;
  color: var(--color-text);
  font-size: 0.86rem;
  font-weight: 800;
}

.planning-team-details > summary span,
.planning-provider-details > summary span {
  display: inline-grid;
  min-width: 1.5rem;
  min-height: 1.5rem;
  place-items: center;
  border-radius: 999px;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  font-size: 0.72rem;
}

.planning-team-details .table-scroll,
.planning-provider-details .table-scroll {
  padding: 0 0.65rem 0.65rem;
}

.planning-team-details .table-scroll {
  overflow-x: auto;
  overflow-y: visible;
}

.planning-team-table th,
.planning-team-table td,
.planning-provider-table th,
.planning-provider-table td {
  padding: 0.55rem 0.5rem;
  font-size: 0.78rem;
}

/* Keep the operational columns compact so that project notes can be read and
   edited without needless horizontal scrolling. The table still scrolls on
   small screens rather than compressing dates and durations into ambiguity. */
.planning-team-table {
  width: 100%;
  min-width: 62rem;
  table-layout: fixed;
}
.planning-team-table .planning-team-col-team { width: 9%; }
.planning-team-table .planning-team-col-priority { width: 6%; }
.planning-team-table .planning-team-col-designers { width: 8%; }
.planning-team-table .planning-team-col-tasks { width: 6%; }
.planning-team-table .planning-team-col-dates { width: 13%; }
.planning-team-table .planning-team-col-predicted { width: 8%; }
.planning-team-table .planning-team-col-actual { width: 8%; }
.planning-team-table .planning-team-col-ratio { width: 9%; }
.planning-team-table .planning-team-col-notes { width: 42%; }
.planning-team-table.has-predicted-time .planning-team-col-notes { width: 33%; }

.planning-team-dot {
  display: inline-block;
  width: 0.62rem;
  height: 0.62rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--color-muted);
}

.planning-team-color-1 { background: #e48238; }
.planning-team-color-2 { background: #4c9dcb; }
.planning-team-color-3 { background: #749f70; }
.planning-team-color-4 { background: #b88d55; }
.planning-team-color-5 { background: #9b79c7; }
.planning-team-note-cell { min-width: 18rem; }
.planning-team-note-current { max-width: none; overflow-wrap: anywhere; }
.planning-team-note-current.is-editable { min-height: 2.35rem; padding: .28rem .38rem; border: 1px dashed transparent; border-radius: .42rem; cursor: text; }
.planning-team-note-current.is-editable:hover,
.planning-team-note-current.is-editable:focus-visible { border-color: var(--color-primary); background: var(--color-primary-soft); outline: none; }
.planning-team-note-entry,
.planning-team-note-empty { margin: 0; }
.planning-team-note-entry + .planning-team-note-entry { margin-top: .32rem; padding-top: .32rem; border-top: 1px solid var(--color-border); }
.planning-team-note-entry { border-radius: .25rem; }
.planning-team-note-entry:hover { color: var(--color-primary-strong); }
.planning-team-note-empty { color: var(--color-muted); }
.planning-team-note-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .42rem; margin-top: .45rem; }
.planning-team-note-hint { color: var(--color-muted); font-size: .72rem; }
.planning-team-note-editor-dock { margin: 0 .65rem .65rem; padding: .75rem; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface-elevated); }
.planning-team-note-editor-dock[hidden] { display: none; }
.planning-team-note-editor-dock .planning-team-note-controls { margin-top: 0; }
.planning-team-note-form { display: flex; flex-wrap: wrap; align-items: center; width: 100%; min-width: 0; gap: .38rem; margin-top: .48rem; }
.planning-team-note-form[hidden] { display: none; }
.planning-team-note-form textarea { flex: 1 0 100%; box-sizing: border-box; width: 100%; min-width: 0; min-height: 7rem; resize: vertical; }
.planning-team-note-form button { flex: 0 1 auto; min-width: 0; }
.planning-team-note-form span { flex: 1 0 100%; color: var(--color-muted); font-size: .72rem; }
.planning-provider-date { width: 100%; min-width: 7rem; padding: 0; border: 0; color: inherit; background: transparent; cursor: pointer; text-align: left; font: inherit; }
.planning-provider-date:hover { color: var(--color-primary-strong); text-decoration: underline; }
.planning-provider-date-form {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .3rem;
  min-width: max-content;
}
.planning-provider-date-form[hidden] { display: none; }
.planning-provider-date-form input[type="date"] { order: 2; width: 8.7rem; min-width: 8.7rem; min-height: 2rem; padding: .28rem .38rem; }
.planning-provider-date-form button { order: 1; }

.planning-timeline-panel {
  overflow: hidden;
  margin-bottom: 1rem;
}

.planning-timeline-range {
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.planning-timeline-scale {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  margin: 0 1rem 0.35rem 9.1rem;
  min-width: 0;
  color: var(--color-muted);
  font-size: 0.68rem;
}

.planning-timeline-scale span { white-space: nowrap; }

.planning-timeline-list {
  display: grid;
  gap: 0.35rem;
}

.planning-timeline-row {
  display: grid;
  grid-template-columns: 8.35rem minmax(13rem, 1fr);
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.18rem 1rem;
}

.planning-timeline-row > a {
  overflow: hidden;
  color: var(--color-text);
  font-size: 0.8rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-timeline-row > a:hover {
  color: var(--color-primary-strong);
}

.planning-timeline-track {
  display: flex;
  min-width: 0;
  min-height: 1rem;
  overflow: hidden;
  border-radius: 0.25rem;
  background: repeating-linear-gradient(90deg, rgba(119, 143, 169, 0.14) 0, rgba(119, 143, 169, 0.14) 1px, transparent 1px, transparent 14px);
}

.planning-timeline-track i { flex: 1 1 0; min-width: 1px; }
.planning-timeline-track i.is-active { background: linear-gradient(90deg, #4c9dcb, var(--color-primary-strong)); }
.planning-timeline-track i.is-active.is-delayed { background: linear-gradient(90deg, #cc6666, var(--color-danger)); }
.planning-timeline-track i.is-active.is-suspended { background: repeating-linear-gradient(135deg, #b99747 0, #b99747 5px, #796c4d 5px, #796c4d 10px); }

/* Current portfolio workload / Efficiency */
.efficiency-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.efficiency-hero h1 { margin: .1rem 0 .35rem; font-size: 1.45rem; }
.efficiency-hero p:not(.eyebrow) { max-width: 58rem; margin: 0; color: var(--color-muted); }
.efficiency-legend { display: flex; flex-wrap: wrap; justify-content: end; gap: .42rem; }
.efficiency-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.8rem;
  min-height: 1.7rem;
  padding: .12rem .48rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}
.efficiency-status-success { color: #b7eccd; border-color: rgba(79, 170, 120, .52); background: rgba(79, 170, 120, .12); }
.efficiency-status-warning { color: #ffe2a0; border-color: rgba(220, 166, 74, .54); background: rgba(220, 166, 74, .12); }
.efficiency-status-danger { color: #ffc2c2; border-color: rgba(208, 100, 100, .54); background: rgba(208, 100, 100, .12); }
.efficiency-status-neutral { color: var(--color-muted); border-color: rgba(132, 146, 166, .48); background: rgba(132, 146, 166, .1); }
.efficiency-filter-panel, .efficiency-table-panel { margin-bottom: 1rem; }
.efficiency-filter-form { grid-template-columns: repeat(4, minmax(11rem, 1fr)); }
.efficiency-filter-form .report-filter-actions { align-self: end; }
.efficiency-metric-grid { grid-template-columns: repeat(5, minmax(145px, 1fr)); margin-bottom: 1rem; }
.efficiency-metric-grid .metric-card small { display: block; margin-top: .24rem; color: var(--color-muted); font-size: .72rem; }
.efficiency-table small { display: block; margin-top: .22rem; color: var(--color-muted); font-size: .72rem; }
.efficiency-table td { white-space: nowrap; }
.efficiency-table td:first-child { white-space: normal; min-width: 12rem; }
.efficiency-table .efficiency-unassigned-row td { background: rgba(132, 146, 166, .08); }
.efficiency-total-row td { border-top: 2px solid var(--color-border-strong, var(--color-border)); background: rgba(235, 122, 24, .08); }
.efficiency-situation { color: #ffe2a0; font-weight: 750; }
.efficiency-negative { color: #ffc2c2; font-weight: 800; }
.efficiency-updated, .panel-note { margin: .85rem 0 0; color: var(--color-muted); font-size: .76rem; }

@media (max-width: 1050px) {
  .efficiency-filter-form { grid-template-columns: repeat(3, minmax(10rem, 1fr)); }
  .efficiency-metric-grid { grid-template-columns: repeat(3, minmax(145px, 1fr)); }
}

@media (max-width: 720px) {
  .efficiency-hero { grid-template-columns: 1fr; }
  .efficiency-legend { justify-content: flex-start; }
  .efficiency-filter-form, .efficiency-metric-grid { grid-template-columns: repeat(2, minmax(135px, 1fr)); }
}

/* Weekly portfolio workload */
.workload-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.workload-hero h1 { margin: .1rem 0 .3rem; font-size: 1.45rem; }
.workload-hero p:not(.eyebrow) { margin: 0; color: var(--color-muted); }
.workload-filter-panel { margin-bottom: 1rem; }
.workload-filter-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: .75rem; align-items: end; }
.workload-filter-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.workload-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.workload-summary-grid .metric-card { min-width: 0; }
.workload-summary-grid .metric-card small { display: block; margin-top: .3rem; color: var(--color-muted); font-size: .71rem; line-height: 1.25; }
.workload-team-panel, .workload-people-panel { margin-bottom: 1rem; }
.workload-load { display: inline-flex; align-items: center; justify-content: center; min-width: 4.4rem; padding: .24rem .45rem; border: 1px solid var(--color-border); border-radius: 999px; font-size: .75rem; font-weight: 800; }
.workload-load-ok, .workload-load-available { color: #b7eccd; border-color: rgba(79, 170, 120, .52); background: rgba(79, 170, 120, .12); }
.workload-load-attention { color: #ffe2a0; border-color: rgba(220, 166, 74, .54); background: rgba(220, 166, 74, .12); }
.workload-load-critical, .workload-load-overloaded { color: #ffc2c2; border-color: rgba(208, 100, 100, .54); background: rgba(208, 100, 100, .12); }
.workload-people-list { display: grid; gap: .55rem; }
.workload-person-card { border: 1px solid var(--color-border); border-radius: .6rem; background: rgba(8, 17, 27, .45); }
.workload-person-card > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(10rem, auto) auto; gap: .7rem; align-items: center; padding: .7rem .8rem; cursor: pointer; list-style: none; }
.workload-person-card > summary::-webkit-details-marker { display: none; }
.workload-person-card[open] > summary { border-bottom: 1px solid var(--color-border); }
.workload-person-card .table-scroll { padding: 0 .7rem .7rem; }
.workload-person-avatar { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 50%; color: #fff; background: var(--color-primary); font-size: .75rem; font-weight: 800; }
.workload-person-card summary > span:nth-child(2) { display: grid; gap: .12rem; min-width: 0; }
.workload-person-card summary small { color: var(--color-muted); font-size: .75rem; }
.workload-person-metrics { display: grid; gap: .16rem; text-align: right; }

/* Read-only macro portfolio load by the team of each project's R1/R2. */
.workload-project-team-panel { margin-bottom: 1rem; }
.workload-project-team-header { margin-bottom: .7rem; }
.workload-project-team-header h2 { margin: .1rem 0 .3rem; }
.workload-project-team-header p:not(.eyebrow), .workload-project-team-note, .workload-project-team-chart .panel-subheader p, .workload-project-team-undetermined .panel-subheader p { color: var(--color-muted); }
.workload-project-team-note { margin: 0 0 .8rem; font-size: .78rem; }
.workload-project-team-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.workload-project-team-summary-grid .metric-card { min-width: 0; min-height: 0; }
.workload-project-team-summary-grid .metric-card small { display: block; margin-top: .3rem; color: var(--color-muted); font-size: .71rem; line-height: 1.25; }
.workload-project-team-chart { display: grid; gap: .55rem; margin: 0 0 1rem; padding: .85rem; border: 1px solid var(--color-border); border-radius: .65rem; background: rgba(8, 17, 27, .28); }
.workload-project-team-chart .panel-subheader, .workload-project-team-undetermined .panel-subheader { display: grid; gap: .16rem; margin-bottom: .2rem; }
.workload-project-team-chart .panel-subheader h3, .workload-project-team-undetermined .panel-subheader h3 { margin: 0; font-size: .92rem; }
.workload-project-team-chart .panel-subheader p, .workload-project-team-undetermined .panel-subheader p { margin: 0; font-size: .75rem; }
.workload-project-team-chart-row { display: grid; grid-template-columns: minmax(10rem, 20%) minmax(5rem, 1fr) minmax(6.5rem, auto); gap: .75rem; align-items: center; }
.workload-project-team-chart-row > span { display: grid; gap: .1rem; min-width: 0; }
.workload-project-team-chart-row small { color: var(--color-muted); font-size: .71rem; }
.workload-project-team-chart-row > strong { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.workload-project-team-chart progress { width: 100%; height: .58rem; overflow: hidden; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--color-border) 72%, transparent); }
.workload-project-team-chart progress::-webkit-progress-bar { background: color-mix(in srgb, var(--color-border) 72%, transparent); }
.workload-project-team-chart progress::-webkit-progress-value { background: var(--color-primary); }
.workload-project-team-chart progress::-moz-progress-bar { background: var(--color-primary); }
.workload-project-team-table { margin-bottom: 1rem; }
.workload-project-team-details-list { display: grid; gap: .55rem; }
.workload-project-team-card { overflow: hidden; border: 1px solid var(--color-border); border-radius: .65rem; background: rgba(8, 17, 27, .45); }
.workload-project-team-card > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .72rem .8rem; cursor: pointer; list-style: none; }
.workload-project-team-card > summary::-webkit-details-marker { display: none; }
.workload-project-team-card[open] > summary { border-bottom: 1px solid var(--color-border); }
.workload-project-team-card > summary > span { display: grid; gap: .12rem; min-width: 0; }
.workload-project-team-card small { color: var(--color-muted); font-size: .73rem; }
.workload-project-team-card > summary > span:last-child { text-align: right; }
.workload-project-team-card .table-scroll { padding: 0 .7rem .7rem; }
.workload-project-team-undetermined { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }

@media (max-width: 960px) {
  .workload-project-team-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .workload-project-team-summary-grid { grid-template-columns: 1fr; }
  .workload-project-team-chart-row { grid-template-columns: minmax(0, 1fr) auto; }
  .workload-project-team-chart-row progress { grid-column: 1 / -1; grid-row: 2; }
}

/* Future workload map: read-only consolidation of the existing Planning data */
.future-workload-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.future-workload-hero h1 { margin: .1rem 0 .3rem; font-size: 1.45rem; }
.future-workload-hero p:not(.eyebrow) { margin: 0; color: var(--color-muted); }
.future-workload-filter-panel, .future-workload-team-panel { margin-bottom: 1rem; }
.future-workload-filter-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: .75rem; align-items: end; }
.future-workload-filter-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.future-workload-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.future-workload-summary-grid .metric-card { min-width: 0; }
.future-workload-summary-grid .metric-card small { display: block; margin-top: .3rem; color: var(--color-muted); font-size: .71rem; line-height: 1.25; }
.future-workload-team-table td small { display: block; margin-top: .16rem; color: var(--color-muted); font-size: .7rem; }
.future-workload-progress { display: block; width: min(8.5rem, 100%); height: .48rem; margin-top: .38rem; overflow: hidden; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--color-border) 72%, transparent); }
.future-workload-progress::-webkit-progress-bar { background: color-mix(in srgb, var(--color-border) 72%, transparent); }
.future-workload-progress::-webkit-progress-value { background: #4faa78; }
.future-workload-progress::-moz-progress-bar { background: #4faa78; }
.future-workload-progress.is-attention::-webkit-progress-value { background: #dca64a; }
.future-workload-progress.is-attention::-moz-progress-bar { background: #dca64a; }
.future-workload-progress.is-critical::-webkit-progress-value { background: #d06464; }
.future-workload-progress.is-critical::-moz-progress-bar { background: #d06464; }
.future-workload-details-list { display: grid; gap: .7rem; margin-bottom: 1rem; }
.future-workload-team-card, .future-workload-person-card { overflow: hidden; border: 1px solid var(--color-border); border-radius: .65rem; background: rgba(8, 17, 27, .45); }
.future-workload-team-card > summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(12rem, auto) auto; gap: .75rem; align-items: center; padding: .78rem .9rem; cursor: pointer; list-style: none; }
.future-workload-team-card > summary::-webkit-details-marker, .future-workload-person-card > summary::-webkit-details-marker { display: none; }
.future-workload-team-card[open] > summary, .future-workload-person-card[open] > summary { border-bottom: 1px solid var(--color-border); }
.future-workload-team-name, .future-workload-team-metrics { display: grid; gap: .13rem; min-width: 0; }
.future-workload-team-name small, .future-workload-team-metrics small, .future-workload-person-card small { color: var(--color-muted); font-size: .73rem; }
.future-workload-team-metrics { text-align: right; }
.future-workload-team-content { padding: .8rem; }
.future-workload-detail-note { margin: 0 0 .75rem; color: var(--color-muted); font-size: .78rem; }
.future-workload-people-list { display: grid; gap: .55rem; }
.future-workload-person-card > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .7rem; align-items: center; padding: .65rem .7rem; cursor: pointer; list-style: none; }
.future-workload-person-card > summary > span:nth-child(2) { display: grid; gap: .13rem; min-width: 0; }
.future-workload-person-card .table-scroll { padding: 0 .7rem .7rem; }
.future-workload-exceptions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }

/* Planning monitoring */
.monitoring-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.monitoring-hero h1 { margin: .1rem 0 .3rem; font-size: 1.45rem; }
.monitoring-hero p:not(.eyebrow) { margin: 0; color: var(--color-muted); }
.monitoring-filter-panel, .monitoring-week-panel, .monitoring-team-panel, .monitoring-people-panel { margin-bottom: 1rem; }
.monitoring-filter-form { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: .75rem; align-items: end; }
.monitoring-filter-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.monitoring-week-navigation { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.monitoring-week-navigation strong { color: var(--color-muted); font-size: .82rem; text-align: center; }
.monitoring-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.monitoring-summary-grid .metric-card { min-height: 0; }
.monitoring-metric-summary { display: block; margin-top: .45rem; color: var(--color-muted); font-size: .72rem; line-height: 1.35; }
.monitoring-metric-info { margin-top: .65rem; padding-top: .55rem; border-top: 1px solid color-mix(in srgb, var(--color-border) 78%, transparent); }
.monitoring-metric-info summary { color: var(--color-primary-strong); cursor: pointer; font-size: .72rem; font-weight: 800; }
.monitoring-metric-info summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; border-radius: 2px; }
.monitoring-metric-info p { margin: .45rem 0 0; color: var(--color-muted); font-size: .7rem; line-height: 1.45; }
.monitoring-metric-info p + p { margin-top: .35rem; }
.monitoring-metric-info p strong { display: inline; margin: 0; color: var(--color-text); font-size: inherit; line-height: inherit; }
.monitoring-week-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); gap: .75rem; }
.monitoring-week-card { display: grid; gap: .7rem; padding: .85rem; border: 1px solid var(--color-border); border-radius: .7rem; background: color-mix(in srgb, var(--color-panel) 78%, transparent); }
.monitoring-week-card > header { display: grid; gap: .12rem; }
.monitoring-week-card > header strong { font-size: .92rem; }
.monitoring-week-card > header small, .monitoring-week-card footer { color: var(--color-muted); font-size: .73rem; }
.monitoring-week-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem .75rem; margin: 0; }
.monitoring-week-card dt { color: var(--color-muted); font-size: .7rem; }
.monitoring-week-card dd { margin: .08rem 0 0; font-size: .78rem; font-weight: 750; }
.monitoring-load-track { position: relative; display: block; overflow: hidden; min-width: 5rem; height: .56rem; border-radius: 999px; background: color-mix(in srgb, var(--color-border) 72%, transparent); }
.monitoring-load-track::after { position: absolute; z-index: 1; top: 0; bottom: 0; left: 85%; width: 1px; background: color-mix(in srgb, var(--color-text) 45%, transparent); content: ""; }
.monitoring-load-track > i { display: block; height: 100%; border-radius: inherit; background: #4faa78; }
.monitoring-load-track > i.is-attention { background: #dca64a; }
.monitoring-load-track > i.is-overloaded { background: #d06464; }
.monitoring-status { display: inline-grid; justify-items: center; gap: .08rem; min-width: 5.4rem; padding: .23rem .45rem; border: 1px solid rgba(79, 170, 120, .52); border-radius: 999px; color: #b7eccd; background: rgba(79, 170, 120, .12); font-size: .73rem; font-weight: 800; line-height: 1.1; text-align: center; }
.monitoring-status small { color: currentColor; font-size: .64rem; font-weight: 650; }
.monitoring-status.is-attention { border-color: rgba(220, 166, 74, .54); color: #ffe2a0; background: rgba(220, 166, 74, .12); }
.monitoring-status.is-overloaded { border-color: rgba(208, 100, 100, .54); color: #ffc2c2; background: rgba(208, 100, 100, .12); }
.monitoring-negative { color: #ffc2c2; font-weight: 750; }
.monitoring-team-table td:first-child small, .monitoring-task-table td:first-child small, .monitoring-task-table td:nth-child(2) small { display: block; margin-top: .16rem; color: var(--color-muted); font-size: .72rem; }
.monitoring-people-list { display: grid; gap: .6rem; }
.monitoring-person-card { overflow: hidden; border: 1px solid var(--color-border); border-radius: .7rem; background: color-mix(in srgb, var(--color-panel) 78%, transparent); }
.monitoring-person-card > summary { display: grid; grid-template-columns: auto minmax(10rem, 1fr) minmax(13rem, .9fr) auto; gap: .75rem; align-items: center; padding: .75rem .85rem; cursor: pointer; list-style: none; }
.monitoring-person-card > summary::-webkit-details-marker { display: none; }
.monitoring-person-card[open] > summary { border-bottom: 1px solid var(--color-border); }
.monitoring-person-card.is-overloaded { border-color: rgba(208, 100, 100, .55); }
.monitoring-person-avatar { display: grid; width: 2.15rem; height: 2.15rem; place-items: center; border-radius: 50%; color: #fff; background: var(--color-primary); font-size: .76rem; font-weight: 800; }
.monitoring-person-identity, .monitoring-person-total { display: grid; gap: .18rem; min-width: 0; }
.monitoring-person-identity small, .monitoring-person-total small { color: var(--color-muted); font-size: .73rem; }
.monitoring-person-total { justify-self: stretch; }
.monitoring-person-content { display: grid; gap: .85rem; padding: .8rem; }
.monitoring-person-week-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .55rem; }
.monitoring-person-week { display: grid; gap: .38rem; padding: .55rem .6rem; border: 1px solid var(--color-border); border-radius: .55rem; }
.monitoring-person-week > header { display: flex; justify-content: space-between; gap: .4rem; font-size: .74rem; }
.monitoring-person-week > header span { font-weight: 800; }
.monitoring-person-week > small { color: var(--color-muted); font-size: .69rem; }
.monitoring-person-week.is-overloaded { border-color: rgba(208, 100, 100, .46); }
.monitoring-person-week.is-attention { border-color: rgba(220, 166, 74, .46); }
.monitoring-task-table th:not(:first-child), .monitoring-task-table td:not(:first-child) { white-space: nowrap; }
.monitoring-specialty-panel { margin-bottom: 1rem; }
.planning-demand-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.planning-demand-grid > .panel { min-width: 0; margin: 0; }
.planning-capacity-settings { overflow: hidden; margin-bottom: 1rem; padding: 0; }
.planning-capacity-settings > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; cursor: pointer; list-style: none; }
.planning-capacity-settings > summary::-webkit-details-marker { display: none; }
.planning-capacity-settings > summary::after { content: '+'; color: var(--color-primary); font-size: 1.25rem; font-weight: 900; }
.planning-capacity-settings[open] > summary { border-bottom: 1px solid var(--color-border); }
.planning-capacity-settings[open] > summary::after { content: '\2212'; }
.planning-capacity-settings > summary > span { display: grid; gap: .16rem; }
.planning-capacity-settings > summary small { color: var(--color-muted); font-size: .75rem; font-weight: 600; }
.planning-capacity-settings-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding: 1rem; }
.planning-capacity-settings-content > section { min-width: 0; padding: .85rem; border: 1px solid var(--color-border); border-radius: .65rem; background: color-mix(in srgb, var(--color-panel) 78%, transparent); }
.planning-capacity-settings-content h3 { margin: 0 0 .25rem; }
.planning-capacity-settings-content p { margin: 0 0 .8rem; color: var(--color-muted); font-size: .78rem; line-height: 1.45; }
.planning-capacity-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; align-items: end; }
.planning-capacity-form .field { min-width: 0; margin: 0; }
.planning-capacity-form .button { align-self: end; }
.planning-capacity-wide { grid-column: 1 / -1; }
.planning-setting-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .65rem; }
.planning-setting-chips span { padding: .25rem .48rem; border: 1px solid var(--color-border); border-radius: 999px; color: var(--color-muted); background: rgba(83, 122, 155, .1); font-size: .72rem; }
.planning-setting-list { display: grid; gap: .4rem; margin-top: .7rem; }
.planning-setting-list > div { display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: .48rem .55rem; border: 1px solid var(--color-border); border-radius: .5rem; background: var(--color-surface); }
.planning-setting-list span { display: grid; gap: .1rem; min-width: 0; }
.planning-setting-list strong { font-size: .78rem; }
.planning-setting-list small { color: var(--color-muted); font-size: .7rem; }
.planning-setting-list form { flex: 0 0 auto; }

@media (max-width: 1050px) {
  .planning-capacity-settings-content { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .planning-demand-grid, .planning-capacity-form { grid-template-columns: 1fr; }
  .planning-capacity-wide { grid-column: auto; }
}

.user-planning-hero,
.user-planning-filter-form,
.user-planning-summary-grid,
.user-planning-workspace {
  display: grid;
  gap: 1rem;
}

.user-planning-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.user-planning-hero h1 {
  margin: 0.08rem 0 0;
  font-size: 1.45rem;
}

.user-planning-hero p:not(.eyebrow) {
  margin: 0.25rem 0 0;
  color: var(--color-muted);
}

.user-planning-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.4rem;
}

.user-planning-legend span {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: 0.08rem 0.48rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.user-planning-legend .is-available { border-color: rgba(83, 157, 114, 0.48); color: #c2f3d8; }
.user-planning-legend .is-vacation { border-color: rgba(78, 135, 192, 0.48); color: #cbe6ff; }
.user-planning-legend .is-absence { border-color: rgba(245, 185, 71, 0.48); color: #ffe2a0; }
.user-planning-legend .is-holiday { border-color: rgba(206, 102, 102, 0.48); color: #ffd1d1; }

.intelligent-planning-panel {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.intelligent-planning-panel .panel-header h2 {
  margin: 0.12rem 0 0;
}

.intelligent-planning-panel .panel-header p:not(.eyebrow) {
  margin: 0.3rem 0 0;
  color: var(--color-muted);
}

.intelligent-planning-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.intelligent-planning-form .field {
  flex: 1 1 22rem;
}

.intelligent-planning-actions {
  display: grid;
  gap: 0.3rem;
}

.intelligent-planning-actions small,
.intelligent-planning-project {
  color: var(--color-muted);
  font-size: 0.76rem;
}

.intelligent-planning-result {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem;
  border: 1px solid rgba(83, 157, 114, 0.46);
  border-radius: 0.6rem;
  background: rgba(55, 137, 90, 0.1);
}

.intelligent-planning-result.is-risk {
  border-color: rgba(245, 185, 71, 0.62);
  background: rgba(164, 111, 25, 0.14);
}

.intelligent-planning-result h3,
.intelligent-planning-result h4,
.intelligent-planning-result p {
  margin: 0;
}

.intelligent-planning-result h3 { font-size: 1rem; }
.intelligent-planning-result h4 { font-size: 0.86rem; }

.intelligent-planning-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.intelligent-planning-metrics > div {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 0.45rem;
  background: rgba(10, 20, 32, 0.32);
}

.intelligent-planning-metrics span { color: var(--color-muted); font-size: 0.68rem; font-weight: 750; }
.intelligent-planning-metrics strong { font-size: 1rem; }

.intelligent-planning-warnings,
.intelligent-planning-alternatives ul,
.intelligent-planning-tech-suggestion ul {
  display: grid;
  gap: 0.32rem;
  margin: 0;
  padding-left: 1.15rem;
}

.intelligent-planning-warnings { color: #ffe2a0; }

.intelligent-planning-alternatives {
  display: grid;
  gap: 0.5rem;
}

.intelligent-planning-tech-suggestion {
  display: grid;
  gap: 0.35rem;
  padding: 0.6rem 0.7rem;
  border-left: 3px solid var(--color-primary-strong);
  border-radius: 0.35rem;
  background: rgba(10, 20, 32, 0.24);
}

.intelligent-planning-task-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.intelligent-planning-task-table th,
.intelligent-planning-task-table td {
  padding: 0.4rem 0.45rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.intelligent-planning-task-table th { color: var(--color-muted); font-size: 0.66rem; }
.intelligent-planning-confirm { display: flex; justify-content: end; }

.task-dependency-list {
  display: grid;
  gap: 0.32rem;
  max-height: 15rem;
  overflow: auto;
  padding: 0.45rem;
  border: 1px solid var(--color-border);
  border-radius: 0.45rem;
  background: rgba(10, 20, 32, 0.25);
}

.task-dependency-list label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.3rem;
  border-radius: 0.32rem;
  cursor: pointer;
  font-size: 0.78rem;
}

.task-dependency-list label:hover { background: var(--color-primary-soft); }
.task-dependency-list input { margin-top: 0.15rem; }

.user-planning-filter-form {
  grid-template-columns: minmax(14rem, 1.25fr) minmax(11rem, 1.3fr) minmax(8.5rem, 0.72fr) minmax(8.5rem, 0.72fr) minmax(13rem, 1fr) auto;
  align-items: end;
}

.user-planning-filter-form .field,
.user-planning-filter-form select {
  min-width: 0;
}

.user-planning-users-list {
  display: grid;
  max-height: 10.5rem;
  overflow: auto;
  padding: 0.35rem;
  border: 1px solid var(--color-border);
  border-radius: 0.45rem;
  background: rgba(10, 20, 32, 0.32);
}

.user-planning-users-list section {
  display: grid;
  gap: 0.14rem;
  padding: 0.28rem 0.2rem;
}

.user-planning-users-list section + section {
  border-top: 1px solid rgba(100, 122, 147, 0.28);
}

.user-planning-users-list strong {
  padding: 0.12rem 0.25rem;
  color: var(--color-muted);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.user-planning-users-list label {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 1.72rem;
  padding: 0.15rem 0.3rem;
  border-radius: 0.3rem;
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.78rem;
}

.user-planning-users-list label:hover {
  background: var(--color-primary-soft);
}

.user-planning-users-list input {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.user-planning-users-list input:disabled + span {
  color: var(--color-muted);
}

.user-planning-users-list label:has(input:checked) {
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
}

.user-planning-users-field small {
  display: block;
  margin-top: 0.35rem;
  color: var(--color-muted);
  font-size: 0.72rem;
}

.user-planning-select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  margin-top: 0.45rem;
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 750;
}

.user-planning-users-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.7rem;
  margin-top: 0.45rem;
}

.user-planning-users-actions .user-planning-select-all {
  margin-top: 0;
}

.user-planning-users-actions .button {
  min-height: 1.9rem;
  padding-block: 0.25rem;
  font-size: 0.72rem;
}

.user-planning-select-all input {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.user-planning-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.user-planning-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.user-planning-workspace {
  grid-template-columns: minmax(16rem, 0.75fr) minmax(0, 3fr);
  align-items: start;
}

.user-planning-status {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(83, 157, 114, 0.42);
  border-radius: 0.55rem;
  color: #c2f3d8;
  background: rgba(55, 137, 90, 0.14);
  font-size: 0.84rem;
  font-weight: 750;
}

.user-planning-status.is-error {
  border-color: rgba(206, 102, 102, 0.48);
  color: #ffd1d1;
  background: rgba(178, 65, 65, 0.14);
}

.user-planning-backlog {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.user-planning-backlog-list {
  display: grid;
  gap: 1rem;
}

.user-planning-backlog-user {
  display: grid;
  gap: 0.45rem;
}

.user-planning-backlog-user + .user-planning-backlog-user {
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-border);
}

.user-planning-backlog-user h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  color: var(--color-text);
  font-size: 0.86rem;
}

.user-planning-backlog-user h3 span {
  display: inline-grid;
  min-width: 1.45rem;
  min-height: 1.45rem;
  place-items: center;
  border-radius: 999px;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  font-size: 0.7rem;
}

.user-planning-board-panel {
  min-width: 0;
  overflow: hidden;
}

.user-planning-board-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  padding-bottom: 0.35rem;
}

.user-planning-board {
  display: grid;
  grid-template-columns: minmax(10.5rem, 12rem) repeat(30, minmax(13.5rem, 15rem));
  align-items: stretch;
  width: max-content;
  min-width: 100%;
}

.user-planning-board-corner,
.user-planning-board-day-header,
.user-planning-user-row-header,
.user-planning-lane {
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.user-planning-board-corner,
.user-planning-board-day-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 0.45rem;
  min-height: 3.2rem;
  padding: 0.62rem 0.65rem;
  background: rgba(18, 31, 47, 0.8);
}

.user-planning-board-corner {
  position: sticky;
  z-index: 4;
  top: 0;
  left: 0;
  grid-template-columns: 1fr;
  background: var(--color-surface-elevated);
}

.user-planning-board-corner strong,
.user-planning-board-day-header strong {
  font-size: 0.8rem;
}

.user-planning-board-corner small {
  color: var(--color-muted);
  font-size: 0.67rem;
}

.user-planning-board-day-header {
  position: sticky;
  z-index: 2;
  top: 0;
}

.user-planning-board-day-header span {
  color: var(--color-primary-strong);
  font-size: 0.7rem;
  font-weight: 850;
}

.user-planning-board-day-header small {
  grid-column: 1 / -1;
  color: #ffd1d1;
  font-size: 0.68rem;
  font-weight: 750;
}

.user-planning-board-day-header.is-holiday {
  background: rgba(126, 57, 57, 0.24);
}

.user-planning-user-row {
  display: contents;
}

.user-planning-user-row-header {
  position: sticky;
  z-index: 1;
  left: 0;
  display: grid;
  align-content: start;
  gap: 0.18rem;
  padding: 0.58rem 0.65rem;
  background: var(--color-surface-elevated);
}

.user-planning-user-row-header strong {
  color: var(--color-text);
  font-size: 0.78rem;
}

.user-planning-user-row-header small {
  color: var(--color-muted);
  font-size: 0.66rem;
}

.user-planning-non-capacity {
  color: #f2c879 !important;
  font-weight: 800;
}

.user-planning-lane {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  min-height: 6.6rem;
  padding: 0.48rem;
  background: rgba(10, 20, 32, 0.44);
  transition: border-color 130ms ease, background 130ms ease;
}

.user-planning-lane > header {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 0.4rem;
  color: var(--color-muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.user-planning-lane > header small {
  color: #c2f3d8;
  font-size: 0.67rem;
}

.user-planning-lane.state-vacation,
.user-planning-lane.state-absence,
.user-planning-lane.state-holiday,
.user-planning-lane.state-unavailable {
  background: rgba(96, 111, 130, 0.15);
}

.user-planning-lane.state-execution-only {
  border-color: rgba(242, 200, 121, 0.42);
  background: rgba(129, 100, 37, 0.12);
}

.user-planning-lane.state-absence,
.user-planning-lane.state-partial-absence {
  border-color: rgba(245, 185, 71, 0.38);
}

.user-planning-lane.state-vacation {
  border-color: rgba(78, 135, 192, 0.38);
}

.user-planning-lane.is-drop-target {
  border-color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  box-shadow: inset 0 0 0 1px var(--color-primary-strong);
}

.user-planning-time-off {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-align: center;
}

.user-planning-lane-cards {
  display: grid;
  gap: 0.38rem;
}

.user-planning-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.48rem;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary-strong);
  border-radius: 0.5rem;
  color: var(--color-text);
  background: var(--color-surface-elevated);
  box-shadow: 0 0.18rem 0.45rem rgba(0, 0, 0, 0.14);
  cursor: grab;
}

.user-planning-card.is-suspended { opacity: 0.56; }
.user-planning-card.is-late { border-left-color: var(--color-danger); }
.user-planning-card.is-dragging { opacity: 0.38; cursor: grabbing; }

.user-planning-card > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.35rem;
}

.user-planning-card > header a {
  overflow: hidden;
  color: var(--color-text);
  font-size: 0.78rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-planning-card > header a:hover { color: var(--color-primary-strong); }

.user-planning-card > header > span {
  padding: 0.08rem 0.34rem;
  border-radius: 999px;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  font-size: 0.66rem;
  font-weight: 850;
}

.user-planning-remove {
  display: inline-grid;
  width: 1.25rem;
  height: 1.25rem;
  place-items: center;
  padding: 0;
  border: 1px solid var(--color-danger);
  border-radius: 50%;
  color: var(--color-danger);
  background: var(--color-surface-elevated);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.user-planning-card > p {
  min-height: 1.9em;
  margin: 0;
  color: var(--color-muted);
  font-size: 0.7rem;
  line-height: 1.32;
}

.user-planning-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.28rem;
  margin: 0;
}

.user-planning-card dl div { min-width: 0; }
.user-planning-card dt { color: var(--color-muted); font-size: 0.6rem; font-weight: 750; }
.user-planning-card dd { margin: 0.08rem 0 0; overflow: hidden; font-size: 0.67rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.user-planning-card small { color: var(--color-muted); font-size: 0.65rem; line-height: 1.25; }
.user-planning-card em { color: #c2f3d8; font-size: 0.66rem; font-style: normal; font-weight: 800; }

.user-planning-add {
  justify-self: start;
  min-height: 1.75rem;
  padding: 0.18rem 0.48rem;
  font-size: 0.66rem;
}

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

  .quick-module-grid,
  .module-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .project-create-product-line {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .project-create-product-line > strong {
    grid-column: span 2;
  }

  .project-create-estimate-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .planning-columns-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workload-filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .future-workload-filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .future-workload-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .monitoring-filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .monitoring-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .planning-project-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .planning-project-edit-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .planning-timeline-scale {
    margin-left: 7.6rem;
  }

  .planning-timeline-row {
    grid-template-columns: 6.85rem minmax(10rem, 1fr);
  }

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

  .user-planning-workspace {
    grid-template-columns: minmax(15rem, 0.7fr) minmax(0, 2fr);
  }

  .balance-filter-form {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .external-task-project-summary {
    grid-template-columns: repeat(3, minmax(7rem, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    width: min(86vw, var(--sidebar-width));
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 15;
    inset: 0;
    display: none;
    background: rgba(23, 32, 42, 0.42);
  }

  .sidebar-open .sidebar-backdrop {
    display: block;
  }

  .legacy-menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .user-menu {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .metric-grid,
  .dashboard-grid,
  .module-roadmap,
  .module-hero,
  .module-card-grid,
  .detail-grid,
  .detail-stats,
  .planning-insights-grid,
  .planning-summary-grid,
  .user-planning-summary-grid {
    grid-template-columns: 1fr;
  }

  .project-pdf-customization-fields {
    grid-template-columns: 1fr;
  }

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

  .module-hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-wide {
    grid-column: auto;
  }

  .detail-header {
    display: grid;
    align-items: start;
  }

  .detail-actions {
    justify-content: stretch;
  }

  .detail-actions .button {
    width: 100%;
  }

  .project-customer-sheet-form,
  .project-customer-sheet-file,
  .project-customer-sheet-file input[type="file"] {
    width: 100%;
  }

  .external-task-project-details-header {
    align-items: start;
    flex-direction: column;
  }

  .external-task-project-summary {
    grid-template-columns: repeat(2, minmax(7rem, 1fr));
  }

  .split-item {
    grid-template-columns: 1fr;
  }

  .panel-header,
  .panel-header-wrap,
  .dashboard-project-search,
  .search-form,
  .table-tools,
  .report-filter-form,
  .planning-hero,
  .monitoring-hero,
  .user-planning-hero,
  .planning-project-header {
    display: grid;
    width: 100%;
  }

  .dashboard-profile-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-profile-actions {
    justify-content: flex-start;
  }

  .report-filter-actions {
    flex-wrap: wrap;
  }

  .dashboard-project-search {
    min-width: 0;
  }

  .dashboard-project-search input {
    min-width: 0;
  }

  .dashboard-messages-menu-links { grid-template-columns: 1fr; }

  .payment-note-settlement {
    grid-template-columns: 1fr;
  }

  .external-task-payment-selection {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .external-task-payment-selection .button {
    width: 100%;
  }

  .external-task-payment-settlement {
    align-items: stretch;
  }

  .external-task-payment-selection .external-task-payment-settlement input {
    width: 100%;
  }

  .email-payment-request-summary {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .email-payment-note-validation-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-tools {
    justify-content: stretch;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .project-customer-columns,
  .project-customer-editor-fields {
    grid-template-columns: 1fr;
  }

  .project-customer-editor-fields .project-customer-editor-wide {
    grid-column: auto;
  }

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

  .workflow-form-grid {
    grid-template-columns: 1fr;
  }

  .upload-form {
    grid-template-columns: 1fr;
  }

  .field-textarea {
    grid-column: auto;
  }

  .project-creation-wide {
    grid-column: auto;
  }

  .project-create-product-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-create-product-line > strong {
    grid-column: span 2;
  }

  .project-create-estimate-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-fields {
    grid-template-columns: 1fr;
  }

  .planning-hero-actions {
    grid-auto-flow: row;
  }

  .planning-filter-form,
  .user-planning-filter-form,
  .balance-filter-form,
  .planning-project-overview,
  .planning-project-edit-grid {
    grid-template-columns: 1fr;
  }

  .planning-columns-list,
  .workload-filter-form,
  .workload-summary-grid,
  .workload-hero,
  .future-workload-filter-form,
  .future-workload-summary-grid,
  .future-workload-hero,
  .monitoring-filter-form,
  .monitoring-summary-grid,
  .monitoring-hero { grid-template-columns: 1fr; }

  .workload-person-card > summary { grid-template-columns: auto minmax(0, 1fr); }
  .workload-person-metrics, .workload-person-card > summary > .workload-load { grid-column: 2; justify-self: start; text-align: left; }
  .future-workload-team-card > summary { grid-template-columns: minmax(0, 1fr) auto; }
  .future-workload-team-metrics { grid-column: 1; text-align: left; }
  .future-workload-exceptions-grid { grid-template-columns: 1fr; }
  .monitoring-week-navigation { align-items: stretch; flex-direction: column; }
  .monitoring-week-navigation .button { width: 100%; }
  .monitoring-person-card > summary { grid-template-columns: auto minmax(0, 1fr); }
  .monitoring-person-total, .monitoring-person-card > summary > .monitoring-status { grid-column: 2; justify-self: stretch; }
  .planning-folder-row { grid-template-columns: minmax(7rem, 1fr) minmax(5rem, 1fr) 2rem; }
  .planning-folder-row small { grid-column: 1 / -1; }

  .balance-filter-form .report-filter-actions {
    grid-column: auto;
  }

  .balance-report-header {
    align-items: start;
  }

  .balance-legend {
    justify-content: start;
  }

  .planning-project-actions {
    justify-content: start;
  }

  .user-planning-workspace {
    grid-template-columns: 1fr;
  }

  .user-planning-backlog {
    position: static;
    max-height: none;
  }

  .planning-timeline-scale {
    display: none;
  }

  .planning-timeline-row {
    grid-template-columns: 5.8rem minmax(9rem, 1fr);
    gap: 0.45rem;
    padding-inline: 0.7rem;
  }

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

  .data-table {
    min-width: 0;
  }

  .data-table.users-directory-table {
    min-width: 0;
  }

  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    margin-bottom: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface-elevated);
    overflow: hidden;
  }

  .project-create-estimate-table .project-create-product-line {
    display: block;
  }

  .data-table td {
    display: grid;
    grid-template-columns: 38% minmax(0, 1fr);
    gap: 0.75rem;
    border-bottom: 1px solid var(--color-border);
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--color-muted);
    font-weight: 700;
  }

  .data-table.project-tasks-table td {
    width: 100%;
  }

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

  .data-table.users-directory-table .table-row-actions {
    width: 100%;
  }

  .balance-data-table > tbody > .balance-actions-row > td {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding-right: 0.42rem;
    padding-left: 0.42rem;
  }

  .balance-data-table > tbody > .balance-actions-row > td::before {
    display: none;
    content: none;
  }

  .balance-content-row > .balance-content-spacer {
    display: none;
  }

  .balance-row-actions,
  .balance-row-secondary-actions {
    justify-content: flex-start;
  }

  .balance-row-secondary-actions {
    margin-left: 0;
  }

}

@media (max-width: 1180px) {
  .compact-task-filter-form,
  .validation-tasks-filter-form,
  .messages-filter-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .user-times-row {
    grid-template-columns: minmax(10rem, 0.8fr) minmax(12rem, 2fr) minmax(10rem, 0.85fr);
  }

  .user-times-breakdown {
    grid-column: 2 / -1;
  }
}

@media (max-width: 860px) {
  .compact-task-filter-form,
  .validation-tasks-filter-form,
  .messages-filter-form {
    grid-template-columns: 1fr;
  }

  .task-assignment-row,
  .message-row,
  .user-times-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .task-assignment-row .my-task-category,
  .task-assignment-row .my-task-task-name,
  .message-row .message-main,
  .user-times-track,
  .user-times-total,
  .user-times-breakdown {
    grid-column: 2;
  }

  .task-assignment-row .my-task-line-actions,
  .message-row .my-task-line-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .task-assignment-row .task-inline-assignment {
    grid-column: 1 / -1;
  }

  .user-times-user {
    grid-column: 1 / -1;
  }

  .user-times-metrics,
  .messages-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .task-inline-assignment {
    align-items: stretch;
    flex-direction: column;
  }

  .task-inline-assignment .field,
  .task-inline-assignment input[type="search"] {
    min-width: 0;
    width: 100%;
  }

  .project-create-product-line {
    grid-template-columns: 1fr;
  }

  .project-create-product-line > strong {
    grid-column: auto;
  }

  .project-create-estimate-summary {
    grid-template-columns: 1fr;
  }

  .content-wrap,
  .topbar,
  .app-footer {
    padding-inline: 0.85rem;
  }

  .metric-card {
    min-height: 96px;
  }

  .quick-module-grid,
  .module-hero-stats {
    grid-template-columns: 1fr;
  }

  .data-table td {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .estimate-summary {
    grid-template-columns: 1fr;
  }
}

/* Legacy navigation model, refreshed visually: fixed upper menu plus the
   contextual submenu at the left of the work area. */
:root {
  --context-width: 260px;
  --legacy-topbar-height: 66px;
  --temporary-access-banner-height: 0px;
}

.legacy-topbar {
  position: sticky;
  z-index: 50;
  top: var(--temporary-access-banner-height);
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  grid-template-areas: "identity navigation account";
  align-items: center;
  gap: 0.55rem;
  min-height: 66px;
  padding: 0.55rem 1.1rem;
  border-bottom: 1px solid var(--color-border);
  background: rgba(8, 17, 27, 0.96);
  backdrop-filter: blur(12px);
}

.legacy-topbar-identity {
  grid-area: identity;
  display: flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
  gap: 0.55rem;
}

.legacy-topbar-account {
  grid-area: account;
  display: flex;
  align-items: center;
  justify-self: end;
  min-width: 0;
}

.legacy-menu-toggle {
  display: inline-grid;
  place-items: center;
}

.sidebar-toggle-caret {
  display: block;
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1;
  transition: transform 160ms ease;
}

.sidebar-open .sidebar-toggle-caret {
  transform: rotate(180deg);
}

.legacy-brand {
  display: flex;
  align-items: center;
  width: 205px;
  min-width: 150px;
  padding-right: 0.8rem;
}

.legacy-brand .brand-logo {
  width: min(100%, 190px);
  max-height: 42px;
}

.header-task-timer {
  display: grid;
  flex: 0 0 auto;
  gap: 0.06rem;
  min-width: 112px;
  padding: 0.36rem 0.62rem;
  border: 1px solid #f3a13a;
  border-radius: 7px;
  background: #a84f08;
  color: #fff;
  box-shadow: 0 7px 16px rgba(134, 57, 3, 0.3);
}

.header-task-timer:hover {
  color: #fff;
  border-color: #ffc36e;
  background: #bd5a08;
}

.header-task-timer span {
  color: #ffe3bb;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.header-task-timer strong {
  color: #fff;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1.05;
}

/* Saudação pessoal: dá contexto no início da sessão; a conta do Mestre mantém
   o destaque dourado originalmente pedido. */
.header-welcome {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin-left: 0.1rem;
  padding: 0.38rem 0.72rem 0.38rem 0.42rem;
  border: 1px solid rgba(140, 177, 206, 0.42);
  border-radius: 999px;
  color: #e7f1fa;
  background: linear-gradient(110deg, rgba(56, 91, 122, 0.34), rgba(55, 81, 108, 0.14));
  box-shadow: 0 0 0 1px rgba(140, 177, 206, 0.06), 0 6px 18px rgba(6, 24, 42, 0.18);
}

.header-welcome.is-master {
  border-color: rgba(246, 193, 89, 0.62);
  color: #fff5db;
  background: linear-gradient(110deg, rgba(169, 96, 9, 0.42), rgba(244, 124, 32, 0.18));
  box-shadow: 0 0 0 1px rgba(255, 210, 120, 0.08), 0 6px 18px rgba(107, 58, 0, 0.22);
}

.header-welcome-mark {
  display: inline-grid;
  width: 1.7rem;
  height: 1.7rem;
  place-items: center;
  border-radius: 50%;
  color: #15334c;
  background: linear-gradient(135deg, #d9efff, #8cb1ce);
  box-shadow: 0 3px 9px rgba(85, 143, 190, 0.22);
  font-size: 0.95rem;
}

.header-welcome.is-master .header-welcome-mark {
  color: #5b3100;
  background: linear-gradient(135deg, #fff4c6, #f3ab3c);
  box-shadow: 0 3px 9px rgba(255, 190, 69, 0.32);
}

.header-welcome > span:last-child {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
  line-height: 1.15;
}

.header-welcome strong {
  color: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.header-welcome small {
  color: #c5ddef;
  font-size: 0.61rem;
  white-space: nowrap;
}

.header-welcome-message {
  color: rgba(210, 230, 246, 0.84);
  font-size: 0.55rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.header-welcome.is-master small {
  color: #ffe6b5;
}

.header-welcome.is-master .header-welcome-message {
  color: rgba(255, 232, 192, 0.84);
}

.legacy-main-menu {
  grid-area: navigation;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0.05rem;
  min-width: 0;
  margin-left: 0;
  white-space: nowrap;
}

.legacy-topbar.is-two-row {
  grid-template-columns: minmax(0, 1fr) max-content;
  grid-template-areas:
    "identity account"
    "navigation navigation";
}

.legacy-topbar.is-two-row .legacy-main-menu {
  width: 100%;
  justify-content: center;
}

/* If a complete second row is still wider than the available viewport, use
   the established mobile scroller rather than letting any group overflow. */
.legacy-topbar.is-compact-navigation .legacy-main-menu {
  width: 100%;
  justify-content: flex-start;
  overflow-x: auto;
}

.legacy-topbar.is-compact-navigation .top-nav-group {
  flex: 0 0 auto;
}

.top-nav-group {
  position: relative;
}

.top-nav-group > summary {
  list-style: none;
}

.top-nav-group > summary::-webkit-details-marker {
  display: none;
}

.top-nav-trigger {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.55rem 0.68rem;
  border-radius: 6px;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.035em;
}

.top-nav-overview-link {
  color: inherit;
  text-decoration: none;
}

.top-nav-admin-icon {
  display: block;
  width: 1.12rem;
  height: 1.12rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.top-nav-submenu-indicator {
  margin-left: 0.3rem;
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 0.15s ease;
}

.top-nav-group[open] .top-nav-submenu-indicator {
  transform: rotate(180deg);
}

.top-nav-trigger:hover,
.top-nav-group[open] .top-nav-trigger,
.top-nav-trigger.is-active {
  color: var(--color-text);
  background: var(--color-primary-soft);
}

.top-nav-links {
  position: absolute;
  z-index: 35;
  top: calc(100% + 0.45rem);
  right: 0;
  display: grid;
  min-width: 230px;
  max-height: min(70vh, 580px);
  overflow-y: auto;
  padding: 0.4rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.top-nav-links > a,
.top-nav-links > span {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  color: var(--color-text);
  font-size: 0.86rem;
}

.top-nav-links > a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-provider-receipt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.16rem;
  min-width: 1.65rem;
  min-height: 1.3rem;
  padding: 0.08rem 0.26rem;
  border: 1px solid rgba(255, 160, 0, 0.78);
  border-radius: 999px;
  background: rgba(255, 160, 0, 0.16);
  color: var(--color-text);
  font-size: 0.67rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  animation: balance-provider-receipt-pulse 1.35s ease-in-out infinite;
}

.nav-provider-receipt-badge b {
  color: var(--color-primary-strong);
  font-size: 0.66rem;
}

.nav-provider-payment-note-invoice-badge {
  border-color: rgba(65, 112, 180, 0.76);
  background: rgba(65, 112, 180, 0.13);
}

.top-nav-trigger .nav-provider-receipt-badge {
  margin-left: 0.38rem;
  vertical-align: middle;
}

.top-nav-links .nav-provider-receipt-badge,
.context-link .nav-provider-receipt-badge {
  margin-left: auto;
}

.top-nav-links .nav-provider-receipt-badge + .nav-provider-receipt-badge,
.context-link .nav-provider-receipt-badge + .nav-provider-receipt-badge {
  margin-left: 0.25rem;
}

@media (prefers-reduced-motion: reduce) {
  .nav-provider-receipt-badge { animation: none; }
}

.top-nav-links > a:hover,
.top-nav-links > a.is-active {
  background: var(--color-primary-soft);
}

.top-nav-links > .is-unavailable {
  opacity: 0.48;
}

.legacy-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding-left: 0.35rem;
  border-left: 1px solid var(--color-border);
}

.header-quick-action {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(244, 124, 32, 0.42);
  border-radius: 6px;
  color: var(--color-text);
  background: rgba(244, 124, 32, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.header-quick-action:hover,
.header-quick-action:focus-visible,
.header-quick-action.is-active {
  color: var(--color-text);
  border-color: var(--color-primary);
  background: rgba(244, 124, 32, 0.18);
}

.header-quick-action-symbol {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  background: var(--color-primary);
  box-shadow: 0 3px 8px rgba(244, 124, 32, 0.24);
}

.header-tasks-symbol { font-size: 1.08rem; font-weight: 850; }
.header-help-symbol { font-size: 1.12rem; font-weight: 850; }

.legacy-topbar .user-menu {
  flex: 0 1 175px;
  margin-left: 0.25rem;
}

.app-shell {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.help-page {
  display: grid;
  gap: 1rem;
}

.help-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.help-hero h2,
.help-manual-group h2 {
  margin: 0;
}

.help-hero p:not(.eyebrow) {
  max-width: 720px;
  margin: 0.45rem 0 0;
  color: var(--color-muted);
}

.help-access-summary {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(244, 124, 32, 0.4);
  border-radius: var(--radius);
  background: rgba(244, 124, 32, 0.08);
}

.help-access-symbol {
  display: inline-grid;
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--color-primary);
  font-weight: 850;
}

.help-access-summary strong {
  display: block;
  color: var(--color-text);
}

.help-access-summary p,
.help-auto-update-note {
  margin: 0.25rem 0 0;
  color: var(--color-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.help-start-guide {
  padding: 0;
  overflow: hidden;
}

.help-start-guide-summary {
  align-items: center;
  padding: 1rem 1.1rem;
  cursor: pointer;
  list-style: none;
}

.help-start-guide-summary::-webkit-details-marker {
  display: none;
}

.help-start-guide[open] .help-manual-group-caret {
  transform: rotate(180deg);
}

.help-start-guide-body {
  border-top: 1px solid var(--color-border);
}

.help-start-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  background: var(--color-border);
  counter-reset: help-start;
}

.help-start-steps li {
  position: relative;
  display: grid;
  gap: 0.35rem;
  min-height: 8.25rem;
  padding: 1.15rem 1rem 1rem 3.65rem;
  background: var(--color-surface);
  counter-increment: help-start;
}

.help-start-steps li::before {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: inline-grid;
  width: 1.85rem;
  height: 1.85rem;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--color-primary);
  content: counter(help-start);
  font-size: 0.82rem;
  font-weight: 850;
}

.help-start-steps strong {
  color: var(--color-text);
}

.help-start-steps span {
  color: var(--color-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.help-manual-group {
  padding: 0;
  overflow: hidden;
}

.help-manual-group-summary {
  align-items: center;
  padding: 1rem 1.1rem;
  cursor: pointer;
  list-style: none;
}

.help-manual-group-summary::-webkit-details-marker {
  display: none;
}

.help-manual-group-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.help-manual-group-caret {
  color: var(--color-primary-strong);
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 180ms ease;
}

.help-manual-group[open] .help-manual-group-caret {
  transform: rotate(180deg);
}

.help-manual-group-body {
  border-top: 1px solid var(--color-border);
}

.help-group-intro {
  max-width: 780px;
  margin: 0.38rem 0 0;
  color: var(--color-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.help-group-count {
  flex: 0 0 auto;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  font-size: 0.76rem;
  font-weight: 750;
}

.help-workflow-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(235px, 0.48fr);
  gap: 1.25rem;
  padding: 1rem 1.1rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

.help-workflow-guide > div > strong,
.help-procedure-steps > strong {
  color: var(--color-text);
  font-size: 0.88rem;
}

.help-workflow-guide ol {
  display: grid;
  gap: 0.38rem;
  margin: 0.55rem 0 0;
  padding-left: 1.2rem;
  color: var(--color-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.help-caution {
  align-self: stretch;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-left: 3px solid var(--color-primary);
  border-radius: 0 0.45rem 0.45rem 0;
  color: var(--color-muted);
  background: rgba(244, 124, 32, 0.08);
  font-size: 0.83rem;
  line-height: 1.45;
}

.help-caution strong {
  color: var(--color-text);
}

.help-procedure-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  padding: 1.1rem;
}

.help-subheading {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.14rem;
}

.help-subheading strong {
  color: var(--color-text);
}

.help-subheading span {
  color: var(--color-muted);
  font-size: 0.83rem;
}

.help-procedure {
  display: grid;
  align-content: start;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.help-procedure-header {
  display: grid;
  gap: 0.28rem;
}

.help-procedure-header p {
  margin: 0;
  color: var(--color-primary);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.help-procedure-header h3 {
  margin: 0;
  color: var(--color-text);
  font-size: 1rem;
}

.help-procedure-header span {
  color: var(--color-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.help-procedure-steps {
  display: grid;
  gap: 0.55rem;
  padding: 0.8rem;
  border-radius: 0.45rem;
  background: var(--color-surface-soft);
}

.help-procedure-steps ol {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.2rem;
  color: var(--color-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.help-procedure-open {
  justify-self: start;
  color: var(--color-primary);
  font-size: 0.84rem;
  font-weight: 750;
}

.help-procedure-open:hover,
.help-procedure-open:focus-visible {
  text-decoration: underline;
}

.help-reference-index {
  border-top: 1px solid var(--color-border);
}

.help-reference-index summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  list-style: none;
}

.help-reference-index summary::-webkit-details-marker {
  display: none;
}

.help-reference-index summary:hover,
.help-reference-index[open] summary {
  background: var(--color-surface-soft);
}

.help-reference-index summary > span:first-child {
  display: grid;
  gap: 0.18rem;
}

.help-reference-index summary strong {
  color: var(--color-text);
  font-size: 0.88rem;
}

.help-reference-index summary small {
  color: var(--color-muted);
  font-size: 0.8rem;
}

.help-reference-index[open] .help-article-caret {
  transform: rotate(180deg);
}

.help-reference-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0 1.1rem 1.1rem;
}

.help-reference-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 0.45rem;
}

.help-reference-item div {
  display: grid;
  gap: 0.2rem;
}

.help-reference-item strong {
  color: var(--color-text);
  font-size: 0.86rem;
}

.help-reference-item span {
  color: var(--color-muted);
  font-size: 0.79rem;
  line-height: 1.35;
}

.help-reference-item > a {
  flex: 0 0 auto;
  color: var(--color-primary);
  font-weight: 800;
}

.help-article-list {
  border-top: 1px solid var(--color-border);
}

.help-article + .help-article {
  border-top: 1px solid var(--color-border);
}

.help-article summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  list-style: none;
}

.help-article summary::-webkit-details-marker {
  display: none;
}

.help-article summary:hover,
.help-article[open] summary {
  background: var(--color-surface-soft);
}

.help-article-heading {
  display: grid;
  gap: 0.2rem;
}

.help-article-heading strong {
  color: var(--color-text);
}

.help-article-heading small {
  color: var(--color-muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.help-article-caret {
  flex: 0 0 auto;
  color: var(--color-primary);
  font-size: 1.15rem;
  transition: transform 160ms ease;
}

.help-article[open] .help-article-caret {
  transform: rotate(180deg);
}

.help-article-content {
  display: grid;
  justify-items: start;
  gap: 0.85rem;
  padding: 0 1.1rem 1rem 2.15rem;
  color: var(--color-muted);
}

.help-article-content ol {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.45;
}

.help-article-content .button {
  font-size: 0.82rem;
}

.help-auto-update-note {
  padding: 0 0.25rem;
}

@media (max-width: 620px) {
  .help-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .help-start-steps,
  .help-procedure-list,
  .help-reference-list,
  .help-workflow-guide {
    grid-template-columns: 1fr;
  }

  .help-start-steps li {
    min-height: 0;
  }

  .help-article-content {
    padding-left: 1.1rem;
  }

  .help-group-count {
    display: none;
  }
}

.context-sidebar {
  position: fixed;
  z-index: 40;
  top: calc(var(--temporary-access-banner-height) + var(--legacy-topbar-height));
  bottom: 0;
  left: 0;
  width: var(--context-width);
  min-height: 0;
  padding: 1rem 0.7rem;
  border-right: 1px solid var(--color-border);
  background: var(--color-secondary);
  overflow-y: auto;
  transform: translateX(-104%);
  transition: transform 180ms ease;
}

.context-sidebar[hidden] {
  display: none !important;
}

.sidebar-open .context-sidebar {
  transform: translateX(0);
}

.sidebar-backdrop {
  position: fixed;
  z-index: 35;
  inset: calc(var(--temporary-access-banner-height) + var(--legacy-topbar-height)) 0 0;
  display: none;
  background: rgba(0, 0, 0, 0.55);
}

.sidebar-open .sidebar-backdrop {
  display: block;
}

.context-sidebar-heading {
  padding: 0 0.55rem 0.8rem;
  border-bottom: 1px solid var(--color-border);
}

.context-sidebar-heading p {
  margin: 0 0 0.12rem;
  color: var(--color-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.context-sidebar-heading h2 {
  margin: 0;
  font-size: 1.02rem;
}

.context-nav {
  display: grid;
  gap: 0.18rem;
  padding-top: 0.65rem;
}

.context-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 39px;
  padding: 0.48rem 0.55rem;
  border-radius: 6px;
  color: var(--color-text);
  font-size: 0.87rem;
}

.context-link:hover,
.context-link.is-active {
  color: var(--color-text);
  background: var(--color-primary-soft);
}

.context-link.is-active {
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.context-link.is-unavailable {
  cursor: not-allowed;
  opacity: 0.48;
}

.context-divider {
  height: 1px;
  margin: 0.38rem 0.25rem;
  background: var(--color-border);
}

.page-heading {
  width: 100%;
  margin: 0;
  padding: 1rem 1.25rem 0;
}

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

.page-heading h1 {
  margin: 0.1rem 0 0;
  font-size: 1.4rem;
  line-height: 1.2;
}

@media (max-width: 1120px) {
  .legacy-brand {
    width: 160px;
    min-width: 130px;
  }

  .header-welcome {
    display: none;
  }

  .legacy-topbar .user-menu {
    flex: 0 0 auto;
  }

  .user-chip {
    gap: 0.38rem;
    max-width: none;
  }

  .user-chip-name {
    display: none;
  }

  .user-chip-compact-initials {
    display: inline;
  }

  .top-nav-trigger {
    padding-inline: 0.45rem;
    font-size: 0.67rem;
  }
}

/* The measured two-row layout retains the welcome and account identity on
   desktop/tablet widths instead of hiding them merely to keep one row. */
@media (min-width: 861px) and (max-width: 1120px) {
  .header-welcome {
    display: inline-flex;
    max-width: 210px;
    overflow: hidden;
  }

  .header-welcome strong,
  .header-welcome small,
  .header-welcome-message {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .legacy-topbar .user-menu {
    flex: 0 0 auto;
  }

  .user-chip-name {
    display: inline;
  }

  .user-chip-compact-initials {
    display: none;
  }

  .top-nav-trigger {
    padding-inline: 0.68rem;
    font-size: 0.72rem;
  }
}

.top-nav-trigger-admin .top-nav-label {
  display: none;
}

.top-nav-trigger-admin .top-nav-submenu-indicator {
  margin-left: 0.22rem;
}

@media (max-width: 860px) {
  .legacy-topbar {
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-template-areas:
      "identity account"
      "navigation navigation";
    min-height: 60px;
    padding: 0.45rem 0.75rem;
  }

  .legacy-topbar-identity {
    gap: 0.45rem;
  }

  .legacy-topbar-account {
    gap: 0;
  }

  .legacy-menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .legacy-brand {
    width: min(48vw, 210px);
    min-width: 0;
    padding-right: 0;
  }

  .header-task-timer {
    min-width: 0;
    padding-inline: 0.48rem;
  }

  .header-task-timer span {
    display: none;
  }

  .header-welcome {
    display: none;
  }

  .legacy-main-menu {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .legacy-topbar.is-two-row .legacy-main-menu {
    justify-content: flex-start;
  }

  .top-nav-group {
    flex: 0 0 auto;
  }

  .top-nav-links {
    right: auto;
    left: 0;
  }

  .legacy-quick-actions {
    margin-left: auto;
  }

  .header-quick-action {
    width: 36px;
    height: 36px;
  }

  .header-quick-action-symbol {
    width: 28px;
    height: 28px;
    font-size: 0.92rem;
  }

  .legacy-topbar .user-menu {
    flex: 0 1 135px;
  }

  .app-shell {
    display: block;
  }

  .context-sidebar {
    position: fixed;
    z-index: 40;
    top: calc(var(--temporary-access-banner-height) + var(--legacy-topbar-height));
    bottom: 0;
    left: 0;
    width: min(84vw, var(--context-width));
    min-height: 0;
    overflow-y: auto;
    transform: translateX(-104%);
    transition: transform 180ms ease;
  }

  .sidebar-open .context-sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 35;
    inset: calc(var(--temporary-access-banner-height) + var(--legacy-topbar-height)) 0 0;
    display: none;
    background: rgba(0, 0, 0, 0.55);
  }

  .sidebar-open .sidebar-backdrop {
    display: block;
  }

  .page-heading {
    padding-inline: 0.85rem;
  }
}

@media (max-width: 520px) {
  .legacy-topbar {
    gap: 0.35rem;
    padding-inline: 0.55rem;
  }

  .legacy-topbar-identity {
    gap: 0.3rem;
  }

  .legacy-brand {
    width: min(22vw, 110px);
  }

  .header-task-timer {
    min-width: 54px;
    padding-inline: 0.35rem;
  }

  .legacy-quick-actions {
    gap: 0;
    padding-left: 0.2rem;
  }

  .header-quick-action {
    width: 32px;
    height: 32px;
  }

  .header-quick-action-symbol {
    width: 24px;
    height: 24px;
  }

  .legacy-topbar-account {
    width: max-content;
    min-width: max-content;
  }

  .legacy-topbar .user-menu {
    flex: 0 0 auto;
    margin-left: 0.1rem;
  }

  .user-chip {
    gap: 0.25rem;
    min-height: 32px;
  }

  .user-chip-compact-initials {
    display: none;
  }
}

/* Gráficos operacionais do painel. O desenho é SVG nativo para não depender
   de bibliotecas externas; os dados já chegam filtrados pelas permissões do servidor. */
.dashboard-charts-panel {
  margin-top: 1.25rem;
  padding: 0;
  overflow: hidden;
}

.dashboard-charts-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem;
  cursor: pointer;
  list-style: none;
}

.dashboard-charts-summary::-webkit-details-marker {
  display: none;
}

.dashboard-charts-summary::after {
  content: '+';
  color: var(--color-primary);
  font-size: 1.15rem;
  font-weight: 900;
}

.dashboard-charts-panel[open] > .dashboard-charts-summary {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
}

.dashboard-charts-panel[open] > .dashboard-charts-summary::after {
  content: '−';
}

.dashboard-charts-summary strong,
.dashboard-charts-summary small {
  display: block;
}

.dashboard-charts-summary small {
  margin-top: 0.16rem;
  color: var(--color-muted);
}

.dashboard-charts-body {
  padding: 1rem;
}

.dashboard-charts-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-charts-toolbar > p {
  margin: 0;
  color: var(--color-muted);
}

.chart-year-form {
  display: flex;
  align-items: end;
  gap: 0.6rem;
}

.chart-controls {
  display: flex;
  align-items: end;
  gap: 0.65rem;
}

.chart-year-form .field {
  min-width: 122px;
  margin: 0;
}

.chart-year-form select {
  min-height: 40px;
  padding-block: 0.45rem;
}

.dashboard-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-chart-loading {
  margin: 0.85rem 0 0;
  color: var(--color-muted);
  font-size: 0.88rem;
}

.dashboard-chart-loading[hidden] {
  display: none;
}

.dashboard-chart-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  min-height: 370px;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(21, 33, 50, 0.98), rgba(11, 22, 35, 0.98));
}

.dashboard-chart-card.is-annual-summary {
  grid-column: 1 / -1;
  min-height: 0;
}

.dashboard-chart-card.is-featured {
  grid-column: 1 / -1;
  min-height: 410px;
  border-color: rgba(114, 183, 227, 0.42);
  background:
    radial-gradient(circle at 90% 0%, rgba(114, 183, 227, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(21, 33, 50, 0.98), rgba(11, 22, 35, 0.98));
}

.dashboard-billed-evolution {
  margin: 1rem 0 1.2rem;
}

.dashboard-billed-evolution .dashboard-chart-card,
.dashboard-billed-evolution .dashboard-chart-card.is-featured {
  min-height: 0;
  padding: 0.9rem 1rem 0.75rem;
}

.dashboard-billed-evolution .dashboard-chart-graphic {
  min-height: 0;
  margin-top: 0.35rem;
}

.dashboard-billed-evolution .dashboard-chart-svg {
  max-width: 1440px;
  margin-inline: auto;
}

.dashboard-billed-evolution .dashboard-chart-pending {
  min-height: 7rem;
  place-content: center;
}

.dashboard-billed-evolution .dashboard-chart-grid-line {
  stroke-dasharray: 1 4;
}

.dashboard-chart-card.is-annual-summary .dashboard-chart-heading p {
  min-height: 0;
}

.dashboard-chart-heading h3 {
  margin: 0;
  color: var(--color-text);
  font-size: 1rem;
}

.dashboard-chart-heading-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dashboard-chart-view-controls {
  display: inline-flex;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(140, 177, 206, 0.35);
  border-radius: 0.55rem;
  background: rgba(7, 17, 29, 0.48);
}

.dashboard-chart-view-button {
  min-height: 30px;
  padding: 0.28rem 0.55rem;
  border: 0;
  border-right: 1px solid rgba(140, 177, 206, 0.26);
  color: var(--color-muted);
  background: transparent;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-chart-view-button:last-child {
  border-right: 0;
}

.dashboard-chart-view-button:hover,
.dashboard-chart-view-button:focus-visible {
  color: var(--color-text);
  background: rgba(140, 177, 206, 0.16);
  outline: none;
}

.dashboard-chart-view-button.is-active {
  color: #06101b;
  background: #72b7e3;
}

.dashboard-chart-heading p {
  min-height: 2.6em;
  margin: 0.35rem 0 0;
  color: var(--color-muted);
  font-size: 0.8rem;
}

.dashboard-chart-heading .dashboard-chart-goal {
  display: inline-flex;
  min-height: 0;
  width: fit-content;
  margin-top: 0.6rem;
  padding: 0.38rem 0.62rem;
  border: 1px solid rgba(247, 185, 85, 0.58);
  border-radius: 999px;
  color: #ffd885;
  background: rgba(247, 185, 85, 0.11);
  font-size: 0.78rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.dashboard-chart-graphic {
  display: grid;
  min-height: 255px;
  flex: 1;
  place-items: center;
  margin-top: 0.6rem;
}

.dashboard-financial-summary {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  place-items: stretch;
  gap: 0.85rem;
}

.dashboard-financial-group {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid rgba(140, 177, 206, 0.2);
  border-radius: 0.65rem;
  background: rgba(140, 177, 206, 0.045);
}

.dashboard-financial-group h4 {
  margin: 0 0 0.75rem;
  color: var(--color-text);
  font-size: 0.82rem;
}

.dashboard-financial-list {
  display: grid;
  gap: 0.58rem;
}

.dashboard-financial-row {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(7.5rem, 1fr) minmax(4.5rem, 1.35fr) auto;
  align-items: center;
  gap: 0.55rem;
}

.dashboard-financial-row.is-zero {
  opacity: 0.55;
}

.dashboard-financial-label {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.38rem;
  color: var(--color-muted);
  font-size: 0.76rem;
}

.dashboard-financial-label i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
}

.dashboard-financial-track {
  display: block;
  height: 0.52rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(169, 182, 198, 0.13);
}

.dashboard-financial-bar {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  transition: width 180ms ease;
}

.dashboard-financial-row strong {
  color: var(--color-text);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.dashboard-chart-pending {
  border: 1px dashed rgba(140, 177, 206, 0.36);
  border-radius: 0.55rem;
  background: rgba(140, 177, 206, 0.05);
}

.dashboard-chart-problem {
  max-width: 22rem;
  text-align: center;
}

.dashboard-chart-svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  overflow: visible;
}

.dashboard-chart-grid-line {
  stroke: rgba(169, 182, 198, 0.18);
  stroke-width: 1;
}

.dashboard-chart-axis {
  stroke: rgba(169, 182, 198, 0.55);
  stroke-width: 1;
}

.dashboard-chart-axis-label {
  fill: var(--color-muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
}

.dashboard-chart-category-label {
  font-size: 10px;
}

.dashboard-chart-bar {
  transition: opacity 140ms ease, filter 140ms ease;
}

.dashboard-chart-bar:hover {
  filter: brightness(1.18);
  opacity: 0.94;
}

.dashboard-chart-line {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
}

.dashboard-chart-area {
  opacity: 0.16;
}

.dashboard-chart-line-point {
  stroke: rgba(6, 16, 27, 0.82);
  stroke-width: 2;
  transition: r 140ms ease, filter 140ms ease;
}

.dashboard-chart-line-point:hover {
  r: 6;
  filter: brightness(1.18);
}

.dashboard-chart-target-line {
  stroke-width: 1.8;
  stroke-dasharray: 7 5;
  opacity: 0.95;
}

.dashboard-chart-target-label {
  fill: #ffd885;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 800;
}

.dashboard-chart-target-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: dashboard-chart-target-pulse 2.2s ease-in-out infinite;
}

@keyframes dashboard-chart-target-pulse {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.7);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-chart-target-pulse {
    animation: none;
  }
}

.dashboard-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.dashboard-chart-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-muted);
  font-size: 0.72rem;
}

.dashboard-chart-legend-marker {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 999px;
}

.dashboard-chart-legend-marker.is-target {
  border-radius: 2px;
}

.dashboard-chart-empty {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.88rem;
  text-align: center;
}

@media (max-width: 980px) {
  .quality-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .quality-edit-hint {
    max-width: none;
    text-align: left;
  }

  .chart-controls {
    align-items: stretch;
  }

  .dashboard-charts-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-chart-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-card.is-featured {
    min-height: 380px;
  }

  .dashboard-billed-evolution .dashboard-chart-card.is-featured {
    min-height: 0;
  }

  .dashboard-financial-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .quality-year-picker {
    width: 100%;
  }

  .quality-year-picker .field {
    flex: 1;
  }

  .quality-chart-graphic {
    min-height: 210px;
  }

  .chart-year-form {
    width: 100%;
  }

  .chart-year-form .field {
    width: 100%;
  }

  .dashboard-chart-card {
    min-height: 340px;
    padding: 0.8rem;
  }

  .dashboard-chart-card.is-featured {
    min-height: 350px;
  }

  .dashboard-billed-evolution .dashboard-chart-card.is-featured {
    min-height: 0;
    padding: 0.8rem;
  }

  .dashboard-chart-heading-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-chart-graphic {
    min-height: 220px;
  }

  .my-task-project > summary {
    padding: 0.75rem;
  }

  .my-task-project-info,
  .my-task-task-row {
    padding-inline: 0.75rem;
  }

  .my-task-line-actions .table-action:not(.table-action-icon) {
    padding-inline: 0.48rem;
  }
}

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

  .my-tasks-filter-search {
    grid-column: span 2;
  }
}

@media (max-width: 860px) {
  .my-tasks-filter-form,
  .my-tasks-filter-search {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .my-tasks-metrics {
    grid-template-columns: 1fr;
  }

  .my-task-project > summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .my-task-project > summary::after {
    grid-column: 1;
    grid-row: 1;
  }

  .my-task-project-meta {
    padding-right: 1.35rem;
  }

  .my-task-project-info {
    align-items: flex-start;
    flex-direction: column;
  }

  .my-task-task-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .my-task-completion-row {
    grid-template-columns: auto minmax(3.6rem, auto) minmax(0, 1fr);
  }

  .my-task-line-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* Digital Archive */
.archive-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.archive-tree-panel {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.archive-tree-panel .archive-tree {
  min-width: max-content;
}

.archive-tree-list {
  margin: 0;
  padding: 0 0 0 0.8rem;
  list-style: none;
}

.archive-tree > .archive-tree-list {
  padding-left: 0;
}

.archive-tree-node {
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr);
  align-items: center;
  padding: 0.14rem 0;
}

.archive-tree-node > .archive-tree-list {
  grid-column: 1 / -1;
}

.archive-tree-node a,
.archive-tree-label {
  min-width: 0;
  padding: 0.34rem 0.42rem;
  border-radius: 0.35rem;
  color: var(--color-text);
  font-size: 0.86rem;
  text-decoration: none;
  white-space: nowrap;
}

.archive-tree-label {
  color: var(--color-muted);
  cursor: default;
}

.archive-tree-node a:hover,
.archive-tree-node.is-current > a {
  background: rgba(229, 123, 48, 0.16);
  color: var(--color-accent);
}

.archive-tree-toggle,
.archive-tree-spacer {
  display: grid;
  width: 1.15rem;
  height: 1.15rem;
  place-items: center;
}

.archive-tree-toggle {
  padding: 0;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.archive-tree-toggle[aria-expanded="false"] {
  transform: rotate(-90deg);
}

.archive-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
  margin-bottom: 0.9rem;
  color: var(--color-muted);
  font-size: 0.82rem;
}

.archive-breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.archive-breadcrumbs a:hover {
  color: var(--color-accent);
}

.archive-filter-form,
.archive-upload-form,
.archive-inline-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: end;
}

.archive-filter-form {
  margin-top: 1rem;
}

.archive-search,
.archive-wide {
  grid-column: span 2;
}

.archive-filter-actions,
.archive-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.archive-actions-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.archive-actions-panel details > summary {
  list-style: none;
  cursor: pointer;
}

.archive-actions-panel details[open] {
  width: 100%;
}

.archive-actions-panel details[open] > summary {
  margin-bottom: 0.7rem;
}

.archive-upload-panel h3,
.archive-people-panel h3,
.archive-documents-panel h3,
.archive-admin-grid h3,
.archive-history-grid h3 {
  margin: 0;
}

.archive-upload-panel p,
.archive-people-panel p,
.archive-documents-panel p,
.archive-admin-grid p,
.archive-history-grid p {
  color: var(--color-muted);
}

.archive-people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.65rem;
}

.archive-people-grid a {
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.025);
  color: var(--color-text);
  text-decoration: none;
}

.archive-people-grid a:hover {
  border-color: var(--color-accent);
}

.archive-people-grid span,
.archive-documents-panel small {
  color: var(--color-muted);
  font-size: 0.76rem;
}

.archive-documents-panel small {
  display: block;
  margin-top: 0.2rem;
}

.archive-document-menu {
  position: relative;
}

.archive-document-menu > summary {
  color: var(--color-accent);
  cursor: pointer;
}

.archive-document-menu > div,
.archive-document-menu form {
  display: grid;
  width: min(260px, 80vw);
  gap: 0.5rem;
  margin-top: 0.4rem;
  padding: 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 0.45rem;
  background: var(--color-panel);
}

.archive-document-menu > div {
  width: min(760px, 88vw);
}

.archive-document-menu .archive-inline-form {
  width: 100%;
  margin: 0;
}

.archive-deleted-label {
  color: #b42318 !important;
  font-weight: 700;
}

.archive-admin-grid,
.archive-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.archive-admin-grid > .panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.archive-admin-grid .archive-inline-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.025);
}

.archive-admin-grid .archive-inline-form .button,
.archive-admin-grid .archive-inline-form .checkbox-field {
  align-self: end;
}

.archive-watcher-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.archive-watcher-list span {
  padding: 0.25rem 0.48rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text);
  font-size: 0.78rem;
}

.archive-watcher-list .is-muted {
  opacity: 0.55;
}

@media (max-width: 1080px) {
  .archive-workspace {
    grid-template-columns: 1fr;
  }

  .archive-tree-panel {
    position: static;
    max-height: 19rem;
  }

  .archive-filter-form,
  .archive-upload-form,
  .archive-inline-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .archive-filter-form,
  .archive-upload-form,
  .archive-inline-form,
  .archive-admin-grid,
  .archive-history-grid {
    grid-template-columns: 1fr;
  }

  .archive-search,
  .archive-wide {
    grid-column: auto;
  }
}

.email-composer-dialog {
  width: min(850px, calc(100vw - 2rem));
  max-height: min(900px, calc(100vh - 2rem));
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 0.85rem;
  color: var(--color-text);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.email-composer-dialog[hidden] { display: none; }

/* Fallback para browsers que não suportam o modal nativo <dialog>. */
.email-composer-dialog.is-fallback-open {
  position: fixed;
  inset: 1rem;
  z-index: 1100;
  display: block;
  height: fit-content;
  margin: auto;
}

body.has-email-composer-open { overflow: hidden; }

.email-composer-dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
.email-composer-form { display: grid; gap: 0.9rem; padding: 1.15rem; overflow: auto; }
.email-composer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0.85rem; }
.email-composer-header h2 { margin: 0; font-size: 1.2rem; }
.email-composer-header p { margin: 0.2rem 0 0; color: var(--color-muted); font-size: 0.86rem; }
.email-composer-status { min-height: 1.25rem; margin: 0; color: var(--color-muted); font-size: 0.88rem; }
.email-composer-status.is-error { color: #d92d20; }
.email-composer-status.is-success { color: #067647; }
.email-mode-choice { display: grid; gap: 0.55rem; padding: 0.85rem; border: 1px solid var(--color-border); border-radius: 0.6rem; background: rgba(83, 122, 155, 0.08); }
.email-mode-options { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.email-mode-options .is-selected { outline: 3px solid rgba(244, 124, 32, 0.3); outline-offset: 2px; }
.email-internal-checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; max-height: 260px; overflow: auto; padding: 0.6rem; border: 1px solid var(--color-border); border-radius: 0.5rem; background: var(--color-panel); }
.email-internal-option { display: flex; align-items: flex-start; gap: 0.45rem; min-width: 0; padding: 0.28rem 0.35rem; border-radius: 0.35rem; color: var(--color-text); cursor: pointer; }
.email-internal-option:hover { background: rgba(83, 122, 155, 0.12); }
.email-internal-option input { width: 1.05rem; min-width: 1.05rem; height: 1.05rem; min-height: 1.05rem; flex: 0 0 1.05rem; margin-top: 0.18rem; padding: 0; }
.email-internal-identity { display: grid; flex: 1 1 0; min-width: 0; gap: 0.05rem; }
.email-internal-option strong { display: block; color: var(--color-text); font-size: 0.9rem; line-height: 1.3; overflow-wrap: anywhere; }
.email-internal-address { display: block; color: var(--color-muted); font-size: 0.8rem; line-height: 1.3; overflow-wrap: anywhere; }
.email-internal-help { grid-column: 1 / -1; margin: 0; color: var(--color-muted); font-size: 0.84rem; }
.email-internal-empty { margin: 0; color: var(--color-muted); font-size: 0.86rem; }
.email-signature-preview { overflow: auto; max-width: 100%; padding: 1rem; border: 1px solid var(--color-border); border-radius: 0.5rem; background: #fff; color: #1c2430; }
.email-signature-preview img { max-width: 100%; height: auto; }
.email-signature-panel { display: grid; gap: 1rem; }
.email-signature-form { display: grid; gap: 0.85rem; }
.email-signature-editor { min-height: 12rem; overflow: auto; padding: 1rem; border: 1px solid var(--color-border); border-radius: 0.55rem; outline: 0; background: #fff; color: #1c2430; }
.email-signature-editor:focus { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(244, 124, 32, 0.15); }
.email-signature-editor img { max-width: 100%; height: auto; }
.email-signature-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center; }
.email-signature-code { padding: 0.75rem; border: 1px solid var(--color-border); border-radius: 0.55rem; background: var(--color-panel); }
.email-signature-code summary { cursor: pointer; color: var(--color-text); font-weight: 750; }
.email-signature-code textarea { width: 100%; margin-top: 0.75rem; min-height: 12rem; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; line-height: 1.45; }
.email-signature-code p { margin: 0.5rem 0 0; color: var(--color-muted); font-size: 0.8rem; }
.email-signature-preview-wrap { display: grid; gap: 0.45rem; }
.email-signature-preview-wrap h3 { margin: 0; font-size: 0.92rem; }
.email-recipient-block, .email-optional-recipient { display: grid; gap: 0.35rem; }
.email-recipient-dual, .email-composer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.email-token-field { position: relative; display: flex; min-height: 42px; flex-wrap: wrap; align-items: center; gap: 0.35rem; padding: 0.35rem 0.45rem; border: 1px solid var(--color-border); border-radius: 0.5rem; background: var(--color-panel); }
.email-token-field:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(244, 124, 32, 0.15); }
.email-token-list { display: contents; }
.email-token { display: inline-flex; max-width: 100%; align-items: center; gap: 0.3rem; padding: 0.18rem 0.45rem; border-radius: 999px; color: var(--color-text); background: rgba(83, 122, 155, 0.19); font-size: 0.78rem; }
.email-token button { border: 0; padding: 0; color: inherit; background: transparent; cursor: pointer; font-size: 1rem; line-height: 1; }
.email-token-field input { min-width: 150px; flex: 1; border: 0; outline: 0; color: var(--color-text); background: transparent; }
.email-suggestions { position: absolute; z-index: 4; top: calc(100% + 0.25rem); right: 0; left: 0; overflow: auto; max-height: 220px; padding: 0.3rem; border: 1px solid var(--color-border); border-radius: 0.5rem; background: var(--color-surface); box-shadow: var(--shadow-soft); }
.email-suggestions button { display: block; width: 100%; padding: 0.48rem 0.6rem; border: 0; border-radius: 0.3rem; color: var(--color-text); background: transparent; cursor: pointer; text-align: left; }
.email-suggestions button:hover { background: rgba(83, 122, 155, 0.14); }
.email-recipient-toggles { display: flex; justify-content: flex-end; gap: 0.4rem; margin-top: -0.35rem; }
.email-context-suggestions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: -0.35rem 0 0.7rem; }
.button-text { padding: 0.2rem 0.35rem; border: 0; color: var(--color-accent); background: transparent; cursor: pointer; font-size: 0.82rem; }
.email-editor-toolbar { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.4rem; border: 1px solid var(--color-border); border-bottom: 0; border-radius: 0.5rem 0.5rem 0 0; background: var(--color-panel); }
.email-editor-toolbar button { min-width: 2rem; padding: 0.25rem 0.42rem; border: 1px solid var(--color-border); border-radius: 0.3rem; color: var(--color-text); background: var(--color-surface); cursor: pointer; }
.email-message-editor { min-height: 220px; padding: 0.75rem; border: 1px solid var(--color-border); border-radius: 0 0 0.5rem 0.5rem; outline: 0; color: var(--color-text); background: var(--color-panel); line-height: 1.5; }
.email-message-editor:empty::before { content: attr(data-placeholder); color: var(--color-muted); }
.email-message-field small { color: var(--color-muted); font-size: 0.78rem; }
.email-dropzone { display: grid; place-items: center; min-height: 95px; gap: 0.35rem; padding: 0.75rem; border: 1px dashed var(--color-border); border-radius: 0.5rem; color: var(--color-muted); background: var(--color-panel); cursor: pointer; text-align: center; }
.email-dropzone.is-dragover { border-color: var(--color-primary); background: rgba(244, 124, 32, 0.09); }
.email-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.email-dropzone span { color: var(--color-text); }
.email-dropzone small { font-size: 0.76rem; }
.email-attachment-list { display: grid; gap: 0.35rem; padding: 0; margin: 0.45rem 0 0; list-style: none; }
.email-attachment-list li { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.45rem 0.55rem; border: 1px solid var(--color-border); border-radius: 0.4rem; font-size: 0.82rem; }
.email-attachment-list button { border: 0; color: #d92d20; background: transparent; cursor: pointer; }
.email-composer-actions { display: flex; justify-content: flex-end; gap: 0.6rem; padding-top: 0.8rem; border-top: 1px solid var(--color-border); }
.email-admin-section { display: grid; gap: 0.75rem; }
.email-admin-section h3 { margin: 0; }
.email-admin-list, .email-template-list, .email-permission-list { display: grid; gap: 0.55rem; }
.email-admin-list form, .email-admin-form, .email-template-form, .email-template-list article, .email-template-list form, .email-permission-list form { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; align-items: center; padding: 0.65rem; border: 1px solid var(--color-border); border-radius: 0.5rem; background: var(--color-panel); }
.email-template-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.email-template-form textarea, .email-template-list textarea { grid-column: 1 / -1; min-height: 110px; }
.email-template-list article { grid-template-columns: 1fr auto; }
.email-template-list article > span { color: var(--color-muted); font-size: 0.82rem; }
.email-template-list details { grid-column: 1 / -1; }
.email-template-list details form { margin-top: 0.55rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.email-permission-list form { grid-template-columns: minmax(150px, 1fr) repeat(6, auto) auto; }
.email-permission-list small { color: var(--color-muted); }
.email-permission-list label { white-space: nowrap; font-size: 0.78rem; }

@media (max-width: 720px) {
  .email-recipient-dual, .email-composer-grid, .email-admin-list form, .email-admin-form, .email-template-form, .email-template-list details form, .email-permission-list form { grid-template-columns: 1fr; }
  .email-internal-checklist { grid-template-columns: 1fr; }
  .email-composer-dialog { width: min(100vw - 1rem, 850px); }
}

/* Administração de emails: a configuração é apresentada por etapas e as
   permissões são abertas apenas para o utilizador em edição. */
.email-admin-hero { display: grid; gap: 1rem; }
.email-admin-hero .panel-header { align-items: flex-start; }
.email-admin-hero h2 { margin: 0.15rem 0 0.35rem; }
.email-admin-hero p { max-width: 64rem; margin: 0; color: var(--color-muted); }
.email-admin-hero .alert { margin: 0; }
.eyebrow { color: var(--color-accent) !important; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; }
.email-admin-navigation { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.email-admin-navigation a { padding: 0.48rem 0.7rem; border: 1px solid var(--color-border); border-radius: 999px; color: var(--color-text); background: var(--color-panel); font-size: 0.82rem; text-decoration: none; }
.email-admin-navigation a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.email-admin-section { display: block; overflow: hidden; padding: 0; scroll-margin-top: 1rem; }
.email-admin-section > .email-section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem; cursor: pointer; list-style: none; }
.email-admin-section > .email-section-header::-webkit-details-marker { display: none; }
.email-admin-section > .email-section-header::after { flex: 0 0 auto; align-self: center; content: '+'; color: var(--color-primary); font-size: 1.2rem; font-weight: 900; }
.email-admin-section[open] > .email-section-header { border-bottom: 1px solid var(--color-border); background: color-mix(in srgb, var(--color-primary) 6%, var(--color-surface)); }
.email-admin-section[open] > .email-section-header::after { content: '−'; }
.email-admin-section-body { display: grid; gap: 1rem; padding: 1rem; }
.email-global-signature-note { display: flex; flex-wrap: wrap; gap: 0.35rem 0.55rem; padding: 0.72rem 0.82rem; border-left: 3px solid var(--color-primary); border-radius: 0 0.55rem 0.55rem 0; color: var(--color-muted); background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface)); font-size: 0.84rem; line-height: 1.45; }
.email-global-signature-note strong { color: var(--color-text); }
.email-global-signature-form { display: grid; gap: 0.65rem; }
.email-global-signature-form .field { display: grid; gap: 0.25rem; }
.email-global-signature-form .field small { color: var(--color-muted); font-size: 0.8rem; }
.email-global-signature-editor { min-height: 11rem; border-radius: 0.5rem; }
.email-global-signature-source textarea { width: 100%; margin-top: 0.75rem; min-height: 11rem; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; line-height: 1.45; }
.email-section-header > div { display: grid; grid-template-columns: auto 1fr; column-gap: 0.7rem; align-items: center; }
.email-section-header h3 { margin: 0; }
.email-section-header p { grid-column: 2; margin: 0.25rem 0 0; color: var(--color-muted); font-size: 0.86rem; }
.email-step { display: grid; width: 1.75rem; height: 1.75rem; grid-row: 1 / span 2; place-items: center; border-radius: 999px; color: #fff; background: var(--color-primary); font-size: 0.82rem; font-weight: 800; }
.email-count, .email-status, .email-permission-badge { flex: 0 0 auto; padding: 0.25rem 0.5rem; border-radius: 999px; color: var(--color-muted); background: rgba(83, 122, 155, 0.16); font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.email-create-card, .email-crm-administrators { border: 1px solid var(--color-border); border-radius: 0.65rem; background: var(--color-panel); }
.email-create-card > summary, .email-crm-administrators > summary { padding: 0.75rem 0.85rem; color: var(--color-text); cursor: pointer; font-weight: 750; }
.email-create-card[open] > summary { border-bottom: 1px solid var(--color-border); }
.email-config-form, .email-template-form, .email-template-edit-form { display: grid; grid-template-columns: minmax(12rem, 2fr) minmax(9rem, 1fr) minmax(9rem, 1fr) auto; gap: 0.75rem; padding: 0.85rem; align-items: end; }
.email-config-form label, .email-template-form label, .email-template-edit-form label { display: grid; gap: 0.3rem; min-width: 0; color: var(--color-muted); font-size: 0.77rem; }
.email-config-form label > span, .email-template-form label > span, .email-template-edit-form label > span { color: var(--color-muted); font-weight: 650; }
.email-subject-form { grid-template-columns: minmax(10rem, 1fr) minmax(15rem, 2fr) minmax(10rem, 1fr) 6rem auto; }
.email-form-wide { grid-column: 1 / -1; }
.email-inline-check { display: flex !important; grid-column: 1 / -1; align-items: center; gap: 0.55rem; color: var(--color-text) !important; font-size: 0.84rem !important; }
.email-inline-check input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--color-primary); }
.email-template-form textarea, .email-template-edit-form textarea { min-height: 9rem; resize: vertical; }
.email-config-list { display: grid; gap: 0.4rem; }
.email-config-list-head, .email-config-row { display: grid; grid-template-columns: minmax(13rem, 1fr) 6rem 8rem minmax(13rem, auto); gap: 0.55rem; align-items: center; }
.email-config-list-head { padding: 0 0.7rem; color: var(--color-muted); font-size: 0.72rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.04em; }
.email-config-row { padding: 0.6rem; border: 1px solid var(--color-border); border-radius: 0.55rem; background: var(--color-panel); }
.email-config-row label { min-width: 0; }
.email-subject-list .email-config-list-head, .email-subject-row { grid-template-columns: minmax(8rem, 0.8fr) minmax(15rem, 2fr) minmax(9rem, 1fr) 5rem minmax(17rem, auto); }
.email-row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 0.45rem; }
.email-row-actions select { min-width: 5.5rem; }
.email-template-list { display: grid; gap: 0.6rem; }
.email-template-list .email-template-card { display: grid; grid-template-columns: 1fr auto; gap: 0.7rem; align-items: center; padding: 0.8rem; border: 1px solid var(--color-border); border-radius: 0.65rem; background: var(--color-panel); }
.email-template-card > div { display: grid; gap: 0.2rem; min-width: 0; }
.email-template-card > div span { overflow: hidden; color: var(--color-muted); font-size: 0.82rem; text-overflow: ellipsis; white-space: nowrap; }
.email-status.is-active { color: #067647; background: rgba(18, 183, 106, 0.14); }
.email-template-card details { grid-column: 1 / -1; }
.email-template-card details summary { color: var(--color-accent); cursor: pointer; font-size: 0.84rem; font-weight: 700; }
.email-template-edit-form { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0.7rem; padding: 0.8rem; border: 1px solid var(--color-border); border-radius: 0.55rem; background: var(--color-surface); }
.email-empty-state { margin: 0; padding: 1rem; border: 1px dashed var(--color-border); border-radius: 0.55rem; color: var(--color-muted); text-align: center; }
.email-permission-help { display: flex; flex-wrap: wrap; gap: 0.35rem 0.55rem; padding: 0.7rem 0.8rem; border-left: 3px solid var(--color-primary); border-radius: 0 0.5rem 0.5rem 0; color: var(--color-muted); background: rgba(244, 124, 32, 0.08); font-size: 0.83rem; }
.email-permission-help strong { color: var(--color-text); }
.email-crm-administrators { padding: 0; }
.email-crm-administrators[open] > summary { border-bottom: 1px solid var(--color-border); }
.email-crm-administrators p { margin: 0.75rem 0.85rem 0; color: var(--color-muted); font-size: 0.83rem; }
.email-crm-administrators > div { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.75rem 0.85rem; }
.email-crm-administrators > div span { padding: 0.28rem 0.5rem; border-radius: 999px; background: rgba(83, 122, 155, 0.16); font-size: 0.78rem; }
.email-permission-search { display: grid; max-width: 31rem; gap: 0.3rem; color: var(--color-muted); font-size: 0.8rem; font-weight: 700; }
.email-permission-no-results { margin: 0; padding: 0.75rem; border: 1px dashed var(--color-border); border-radius: 0.55rem; color: var(--color-muted); }
.email-permission-list { display: grid; gap: 0.5rem; }
.email-permission-list .email-permission-user { border: 1px solid var(--color-border); border-radius: 0.65rem; background: var(--color-panel); }

/* User access management: start with one person, then present each module in
   plain language with the two meaningful access levels side by side. */
.permission-user-search { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem; margin: 1rem 0; }
.permission-user-search .field { flex: 1 1 260px; margin: 0; }
.permission-user-list,
.permission-access-list { display: grid; gap: .65rem; }
.permission-user-card,
.permission-access-row { display: grid; gap: .75rem; padding: .8rem; border: 1px solid var(--color-border); border-radius: .6rem; background: var(--color-surface-elevated); }
.permission-user-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.permission-user-card > div { display: grid; gap: .15rem; }
.permission-user-card span,
.permission-user-card small,
.permission-access-description span,
.permission-editor-help { color: var(--color-muted); }
.permission-access-row { grid-template-columns: minmax(260px, 1fr) minmax(145px, auto) minmax(130px, auto); align-items: center; }
.permission-access-description { display: grid; gap: .2rem; }
.permission-access-row .check-row { margin: 0; white-space: nowrap; }
.permission-editor-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }

@media (max-width: 720px) {
  .permission-user-card,
  .permission-access-row { grid-template-columns: minmax(0, 1fr); }
  .permission-user-card .button { justify-self: start; }
}
.email-permission-user > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.7rem; align-items: center; padding: 0.7rem 0.8rem; cursor: pointer; list-style: none; }
.email-permission-user > summary::-webkit-details-marker { display: none; }
.email-permission-user[open] > summary { border-bottom: 1px solid var(--color-border); }
.email-permission-user summary > span:nth-child(2) { display: grid; gap: 0.1rem; min-width: 0; }
.email-permission-user summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-permission-user summary small { overflow: hidden; color: var(--color-muted); font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.email-user-avatar { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 999px; color: #fff; background: var(--color-primary); font-size: 0.82rem; font-weight: 800; }
.email-permission-badge.has-access { color: #067647; background: rgba(18, 183, 106, 0.14); }
.email-permission-user form { display: grid; grid-template-columns: 1fr; gap: 0.75rem; padding: 0.85rem; border: 0; border-radius: 0; background: transparent; }
.email-permission-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; padding: 0; margin: 0; border: 0; }
.email-permission-options legend { padding: 0 0 0.25rem; color: var(--color-text); font-size: 0.84rem; font-weight: 750; }
.email-permission-options label { display: flex; align-items: flex-start; gap: 0.55rem; padding: 0.65rem; border: 1px solid var(--color-border); border-radius: 0.5rem; cursor: pointer; }
.email-permission-options label:hover { border-color: var(--color-primary); }
.email-permission-options input { width: 1rem; height: 1rem; margin-top: 0.1rem; accent-color: var(--color-primary); }
.email-permission-options label span { display: grid; gap: 0.16rem; }
.email-permission-options label strong { font-size: 0.82rem; }
.email-permission-options label small { color: var(--color-muted); font-size: 0.74rem; line-height: 1.35; }
.email-permission-actions { display: flex; justify-content: flex-end; }

@media (max-width: 920px) {
  .email-subject-form, .email-subject-list .email-config-list-head, .email-subject-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .email-config-list-head { display: none; }
  .email-config-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .email-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .email-template-edit-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .email-admin-section > .email-section-header { display: grid; grid-template-columns: 1fr auto; }
  .email-section-header > div { grid-column: 1 / -1; }
  .email-admin-section > .email-section-header::after { grid-column: 2; grid-row: 2; }
  .email-count { justify-self: start; }
  .email-config-form, .email-template-form, .email-template-edit-form, .email-config-row, .email-subject-form, .email-subject-row, .email-permission-options { grid-template-columns: 1fr; }
  .email-row-actions, .email-form-wide { grid-column: auto; }
  .email-template-list .email-template-card { grid-template-columns: 1fr; }
  .email-template-card details { grid-column: auto; }
  .email-permission-user > summary { grid-template-columns: auto minmax(0, 1fr); }
  .email-permission-user > summary .email-permission-badge { grid-column: 1 / -1; justify-self: start; }
  .email-permission-actions { justify-content: stretch; }
  .email-permission-actions .button { width: 100%; }
}

/* Avaliação de desempenho 2026.  Mantém o mesmo contraste e densidade das
   contas correntes, mas separa visualmente métricas, avaliações e prémios. */
.performance-hero { overflow: hidden; border-top: 3px solid var(--color-primary); }
.performance-hero .panel-header { align-items: flex-start; }
.performance-hero h2 { margin: 0.1rem 0 0.35rem; }
.performance-hero .panel-header p:not(.eyebrow) { max-width: 62rem; }
.performance-cycle-select { display: flex; align-items: end; gap: 0.45rem; min-width: 15rem; }
.performance-cycle-select .field { flex: 1 1 auto; margin: 0; }
.performance-cycle-select .button { flex: 0 0 auto; }
.performance-principles { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.performance-principles span,
.performance-info-badge,
.status-pill { display: inline-flex; align-items: center; min-height: 1.85rem; padding: 0.28rem 0.58rem; border: 1px solid var(--color-border); border-radius: 999px; color: var(--color-muted); background: var(--color-surface); font-size: 0.76rem; font-weight: 700; }
.performance-principles b { margin-right: 0.28rem; color: var(--color-text); }
.performance-management-panel { margin-top: 1rem; }
.performance-relations-panel { margin-top: 1rem; scroll-margin-top: 5.5rem; }
.performance-legacy-history { margin-top: 1rem; scroll-margin-top: 5.5rem; }
.performance-legacy-history-active { margin-top: 1.25rem; border-top: 3px solid var(--color-primary); }
.performance-support-hub { margin: 1rem 0 1.4rem; }
.performance-support-hub .performance-management-panel,
.performance-support-hub .performance-relations-panel,
.performance-support-hub .performance-legacy-history,
.performance-support-hub .performance-assessment-status-panel,
.performance-support-hub .performance-insights,
.performance-support-hub .performance-results-panel { margin: 0.75rem 0 0; }
.performance-support-hub .performance-management-panel:first-child { margin-top: 0; }
.performance-disclosure { overflow: hidden; margin: 1rem 0; }
.performance-disclosure-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.95rem 1rem; cursor: pointer; list-style: none; }
.performance-disclosure-summary::-webkit-details-marker,
.performance-subdisclosure > summary::-webkit-details-marker,
.performance-assignment-group > summary::-webkit-details-marker { display: none; }
.performance-disclosure-summary::after,
.performance-assignment-group > summary::after { flex: 0 0 auto; width: 1.45rem; height: 1.45rem; display: grid; place-items: center; border: 1px solid var(--color-border); border-radius: 999px; color: var(--color-primary-strong); content: '+'; font-size: 1rem; font-weight: 800; line-height: 1; }
.performance-disclosure[open] > .performance-disclosure-summary::after,
.performance-assignment-group[open] > summary::after { content: '\2212'; }
.performance-disclosure-summary > span:first-child { display: grid; gap: 0.12rem; min-width: 0; }
.performance-disclosure-summary .eyebrow { margin: 0; }
.performance-disclosure-summary strong { font-size: 1rem; }
.performance-disclosure-summary small { color: var(--color-muted); font-size: 0.76rem; line-height: 1.35; }
.performance-disclosure-content { padding: 0 1rem 1rem; border-top: 1px solid var(--color-border); }
.performance-disclosure-content > :first-child { margin-top: 1rem; }
.performance-management-panel .performance-management-actions { margin-top: 0; }
.performance-subdisclosure { margin-top: 0.8rem; border-top: 1px solid var(--color-border); }
.performance-subdisclosure > summary { padding: 0.8rem 0; cursor: pointer; color: var(--color-text); font-size: 0.84rem; font-weight: 800; }
.performance-subdisclosure-content { padding: 0.1rem 0 0.45rem; }
.performance-assessment-status-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.performance-assessment-status-panel > summary > span { display: grid; gap: 0.16rem; }
.performance-assessment-status-panel > summary small { color: var(--color-muted); font-size: 0.74rem; font-weight: 600; line-height: 1.35; }
.performance-assessment-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.55rem; }
.performance-assessment-status-person { display: grid; gap: 0.55rem; padding: 0.7rem; border: 1px solid var(--color-border); border-radius: 0.55rem; background: var(--color-surface); }
.performance-assessment-status-person > div:first-child { display: grid; gap: 0.12rem; }
.performance-assessment-status-person strong { font-size: 0.8rem; }
.performance-assessment-status-person small { color: var(--color-muted); font-size: 0.7rem; }
.performance-assessment-status-person .performance-assessment-prize { margin-top: 0.14rem; color: var(--color-text); line-height: 1.35; }
.performance-assessment-prize b { color: var(--color-primary-strong); }
.performance-assessment-status-trail { display: flex; flex-wrap: wrap; gap: 0.36rem; }
.performance-assessment-initial { display: inline-flex; align-items: center; gap: 0.3rem; min-height: 1.7rem; padding: 0.18rem 0.4rem 0.18rem 0.24rem; border: 1px solid var(--color-border); border-radius: 999px; color: var(--color-muted); background: #f8fafc; font-size: 0.65rem; font-weight: 700; text-decoration: none; }
.performance-assessment-initial b { display: grid; width: 1.18rem; height: 1.18rem; place-items: center; border-radius: 999px; color: #8a4d00; background: rgba(244, 124, 32, 0.14); font-size: 0.58rem; }
.performance-assessment-initial.is-submitted { border-color: rgba(18, 183, 106, 0.34); color: #067647; background: rgba(18, 183, 106, 0.08); }
.performance-assessment-initial.is-submitted b { color: #067647; background: rgba(18, 183, 106, 0.18); }
.performance-assessment-initial.is-submitted:hover { border-color: #16a36a; }
.performance-insights .performance-metric-section:first-child { margin-top: 0; }
.performance-insights .performance-deviation-section { margin-bottom: 0; }
.performance-legacy-table td,
.performance-legacy-table th { white-space: nowrap; }
.performance-legacy-detail { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.performance-legacy-detail h4 { margin: 0.1rem 0 0.3rem; }
.performance-legacy-detail h5 { margin: 0; font-size: 0.9rem; }
.performance-legacy-message { margin-top: 0.9rem; }
.performance-legacy-suggestion { margin: 0.85rem 0; padding: 0.8rem; border: 1px solid var(--color-border); border-radius: 0.6rem; background: var(--color-surface); }
.performance-legacy-suggestion p { margin: 0.35rem 0 0; white-space: pre-line; }
.performance-legacy-answer-group { margin-top: 0.85rem; padding: 0.85rem; border: 1px solid var(--color-border); border-radius: 0.6rem; background: var(--color-surface); }
.performance-legacy-answer-group > .table-responsive { margin-top: 0.6rem; }
.performance-legacy-detail-table td { vertical-align: top; }
.performance-legacy-detail-table td:last-child,
.performance-legacy-detail-table th:last-child { width: 1%; text-align: center; white-space: nowrap; }
.performance-legacy-answer-text { min-width: 19rem; color: var(--color-muted); line-height: 1.4; }
.performance-relations-table th,
.performance-relations-table td { white-space: nowrap; }
.performance-relations-table th:nth-child(n + 3):nth-child(-n + 6),
.performance-relations-table td:nth-child(n + 3):nth-child(-n + 6) { width: 1%; text-align: center; }
.performance-relation-editor { margin-top: 0.9rem; padding: 0.9rem; border: 1px solid var(--color-border); border-radius: 0.65rem; background: var(--color-surface); }
.performance-relation-editor-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 0.8rem; }
.performance-relation-editor-heading > div { display: grid; gap: 0.1rem; }
.performance-relation-editor-heading span { color: var(--color-muted); font-size: 0.69rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.045em; }
.performance-relation-editor-heading strong { font-size: 1rem; }
.performance-relation-editor-heading small,
.performance-relation-editor-heading p { margin: 0; color: var(--color-muted); font-size: 0.75rem; line-height: 1.35; }
.performance-relation-editor-heading p { max-width: 26rem; text-align: right; }
.performance-relation-selects { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7rem; }
.performance-relation-selects .field { min-width: 0; margin: 0; }
.performance-relation-selects select { width: 100%; min-height: 7.7rem; }
.performance-relation-selects small { display: block; margin-top: 0.25rem; color: var(--color-muted); font-size: 0.68rem; line-height: 1.25; }
.performance-status { display: grid; justify-items: end; gap: 0.2rem; color: var(--color-muted); font-size: 0.72rem; font-weight: 750; }
.status-pill { color: var(--color-text); text-transform: capitalize; }
.status-open { color: #a35a00; background: rgba(244, 124, 32, 0.12); }
.status-review { color: #315f93; background: rgba(83, 122, 155, 0.15); }
.status-closed { color: #067647; background: rgba(18, 183, 106, 0.14); }
.status-locked { color: #9a3412; background: rgba(234, 88, 12, 0.13); }
.performance-management-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 0.6rem; margin-top: 0.85rem; }
.performance-inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem; }
.performance-inline-form .field { min-width: 7rem; margin: 0; }
.performance-action-form { margin: 0; }
.performance-cycle-people-add { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.performance-cycle-people-add-form { margin-top: 0.8rem; }
.performance-cycle-people-add-form .field { min-width: min(100%, 28rem); }
.performance-cycle-people-add-form select { width: 100%; }
.performance-eligibility-exceptions { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.performance-eligibility-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.performance-eligibility-heading > div { min-width: 0; }
.performance-eligibility-heading h4 { margin: 0.12rem 0 0.25rem; font-size: 0.98rem; }
.performance-eligibility-heading p:last-child { max-width: 48rem; margin: 0; color: var(--color-muted); font-size: 0.78rem; line-height: 1.4; }
.performance-eligibility-count,
.performance-eligibility-locked { flex: 0 0 auto; padding: 0.32rem 0.54rem; border-radius: 999px; color: #9a3412; background: rgba(234, 88, 12, 0.13); font-size: 0.7rem; font-weight: 800; white-space: nowrap; }
.performance-eligibility-list { display: grid; gap: 0.55rem; margin-top: 0.8rem; }
.performance-eligibility-person { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.72rem 0.8rem; border: 1px solid var(--color-border); border-radius: 0.6rem; background: var(--color-surface); }
.performance-eligibility-person > div { display: grid; gap: 0.13rem; min-width: 0; }
.performance-eligibility-person strong { font-size: 0.86rem; }
.performance-eligibility-person small,
.performance-eligibility-note { color: var(--color-muted); font-size: 0.72rem; line-height: 1.35; }
.performance-eligibility-note { margin: 0.75rem 0 0; }
.performance-cycle-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin: 1rem 0; border: 1px solid var(--color-border); border-radius: 0.65rem; background: var(--color-border); }
.performance-cycle-summary > div { display: grid; gap: 0.24rem; padding: 0.8rem 0.95rem; background: var(--color-panel); }
.performance-cycle-summary span { color: var(--color-muted); font-size: 0.7rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.045em; }
.performance-cycle-summary strong { font-size: 0.88rem; }
.performance-metric-section { margin: 1.4rem 0; }
.performance-metric-section > .panel-header { align-items: end; }
.performance-metric-section > .panel-header p:last-child { max-width: 34rem; margin: 0; text-align: right; }
.performance-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.performance-metric { display: grid; grid-template-rows: auto auto 5px auto; gap: 0.6rem; min-width: 0; padding: 0.85rem; border: 1px solid var(--color-border); border-radius: 0.65rem; background: var(--color-panel); }
.performance-metric-heading { display: flex; justify-content: space-between; align-items: start; gap: 0.5rem; color: var(--color-muted); font-size: 0.75rem; font-weight: 750; line-height: 1.3; }
.performance-metric-heading b { flex: 0 0 auto; color: #8d5d14; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; }
.performance-metric.is-positive .performance-metric-heading b { color: #087a4b; }
.performance-metric.is-neutral .performance-metric-heading b { color: var(--color-muted); }
.performance-metric > strong { font-size: 1.45rem; line-height: 1; }
.performance-meter { display: block; width: 100%; height: 5px; overflow: hidden; border: 0; border-radius: 99px; color: #c7771f; background: rgba(83, 122, 155, 0.2); appearance: none; -webkit-appearance: none; }
.performance-meter::-webkit-progress-bar { border-radius: inherit; background: rgba(83, 122, 155, 0.2); }
.performance-meter::-webkit-progress-value { border-radius: inherit; background: currentColor; }
.performance-meter::-moz-progress-bar { border-radius: inherit; background: currentColor; }
.performance-metric.is-positive .performance-meter { color: #16a36a; }
.performance-metric.is-neutral .performance-meter { color: #8092a8; }
.performance-metric small { color: var(--color-muted); font-size: 0.7rem; line-height: 1.4; }
.performance-deviation-section { margin: 1.4rem 0; }
.performance-info-badge { color: #315f93; background: rgba(83, 122, 155, 0.13); }
.performance-deviation-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin-top: 0.75rem; border: 1px solid var(--color-border); border-radius: 0.6rem; background: var(--color-border); }
.performance-deviation-list article { display: grid; gap: 0.35rem; padding: 0.75rem; background: var(--color-surface); }
.performance-deviation-list span { color: var(--color-muted); font-size: 0.75rem; font-weight: 700; line-height: 1.35; }
.performance-deviation-list strong { font-size: 1.05rem; }
.performance-deviation-list small { color: var(--color-muted); font-size: 0.69rem; }
.performance-assessment-list { margin: 1.4rem 0; }
.performance-assignment-groups { display: grid; gap: 0.65rem; }
.performance-assignment-group { overflow: hidden; border: 1px solid var(--color-border); border-radius: 0.65rem; background: var(--color-panel); }
.performance-assignment-group > summary { display: flex; align-items: center; justify-content: flex-start; gap: 0.75rem; padding: 0.75rem 0.8rem; cursor: pointer; list-style: none; }
.performance-assignment-group > summary > span:first-child { display: grid; gap: 0.18rem; min-width: 0; }
.performance-assignment-group > summary small { color: var(--color-muted); font-size: 0.72rem; }
.performance-assignment-group-count { display: inline-grid; min-width: 1.6rem; height: 1.6rem; margin-left: auto; place-items: center; border-radius: 999px; color: var(--color-primary-strong); background: rgba(244, 124, 32, 0.13); font-size: 0.72rem; font-weight: 800; }
.performance-assignment-group .performance-assignment-cards { margin: 0; padding: 0 0.7rem 0.7rem; }
.performance-self-assignment { margin-bottom: 0; }
.performance-cycle-locked { margin: 1rem 0; }
.performance-assessment-lock-message { margin: 0.85rem 0.7rem; }
.performance-assignment-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin-top: 0.85rem; }
.performance-assignment-card { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; padding: 0.8rem; border: 1px solid var(--color-border); border-radius: 0.6rem; background: var(--color-surface); }
.performance-assignment-card > div { display: grid; gap: 0.15rem; min-width: 0; }
.performance-assignment-card span { color: var(--color-accent); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.045em; }
.performance-assignment-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.performance-assignment-card small { color: var(--color-muted); font-size: 0.72rem; }
.performance-assignment-card .performance-assignment-prize { color: var(--color-text); line-height: 1.35; }
.performance-assignment-prize b { color: var(--color-primary-strong); }
.performance-assignment-actions { display: flex !important; align-items: center; justify-content: flex-end; gap: 0.45rem; }
.performance-assignment-select { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--color-muted); font-size: 0.7rem; font-weight: 750; cursor: pointer; }
.performance-assignment-select input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--color-primary); }
.performance-bulk-selector-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; padding: 0 0.7rem 0.75rem; color: var(--color-muted); font-size: 0.72rem; line-height: 1.35; }
.performance-bulk-selector-actions .button { flex: 0 0 auto; }
.performance-bulk-edit-selector-actions { padding-top: 0.75rem; border-top: 1px solid var(--color-border); }
.performance-form-panel { margin: 1.4rem 0; }
.performance-form-panel { scroll-margin-top: 5.5rem; }
.performance-assignment-warning { margin: 1rem 0; }
.performance-rubric-form { display: grid; gap: 0.65rem; margin-top: 0.9rem; }
.performance-question { display: grid; grid-template-columns: minmax(220px, 1fr) 8rem minmax(230px, 1fr); gap: 0.7rem; align-items: end; padding: 0.8rem; border: 1px solid var(--color-border); border-radius: 0.6rem; background: var(--color-surface); }
.performance-question > div { position: relative; padding-left: 2.3rem; }
.performance-question > div > span { position: absolute; top: 0; left: 0; display: grid; width: 1.65rem; height: 1.65rem; place-items: center; border-radius: 999px; color: var(--color-primary-strong); background: rgba(244, 124, 32, 0.15); font-size: 0.73rem; font-weight: 800; }
.performance-question h4 { margin: 0; font-size: 0.88rem; }
.performance-question p { margin: 0.2rem 0 0; color: var(--color-muted); font-size: 0.74rem; line-height: 1.35; }
.performance-question .field { margin: 0; }
.performance-question textarea { resize: vertical; }
.performance-rubric-submit { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.15rem; }
.performance-rubric-submit small { color: var(--color-muted); font-size: 0.75rem; }
.performance-self-evaluation { margin: 1.4rem 0; scroll-margin-top: 5.5rem; }
.performance-self-page-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin: 0 0 0.7rem; }
.performance-self-page-heading h2 { margin: 0; font-size: 1.28rem; }
.performance-self-page-heading p { margin: 0.35rem 0 0; color: var(--color-muted); font-weight: 750; }
.performance-self-form { overflow: hidden; border: 1px solid var(--color-border); border-top: 3px solid #5a8ef6; border-radius: 0.7rem; background: var(--color-surface); box-shadow: var(--shadow-sm); }
.performance-self-form-header { display: flex; justify-content: flex-end; padding: 0.8rem 1rem 0.6rem; color: #3d4654; font-size: 0.78rem; font-weight: 800; }
.performance-self-questions { padding: 0 0.7rem; }
.performance-self-question { margin: 0; }
.performance-self-question h3,
.performance-self-question > p { margin: 0; padding: 0.52rem 0.65rem; color: #fff; background: #629fa1; font-size: 0.8rem; line-height: 1.35; }
.performance-self-question h3 { border-bottom: 1px solid rgba(255, 255, 255, 0.45); font-weight: 800; }
.performance-self-question > p { font-weight: 650; }
.performance-self-options { margin-bottom: 0.42rem; }
.performance-self-option { display: grid; grid-template-columns: minmax(0, 1fr) 2.4rem; align-items: center; gap: 0.75rem; min-height: 2.28rem; padding: 0.36rem 0.48rem; border-bottom: 1px solid var(--color-border); color: var(--color-text); background: var(--color-surface); font-size: 0.78rem; line-height: 1.32; cursor: pointer; }
.performance-self-option:hover { background: rgba(98, 159, 161, 0.07); }
.performance-self-option:has(input:checked) { color: #173e44; background: rgba(98, 159, 161, 0.13); font-weight: 700; }
.performance-self-option input { justify-self: center; width: 1rem; height: 1rem; margin: 0; accent-color: #4f9194; }
.performance-self-option input:disabled { cursor: default; }
.performance-self-total { display: grid; grid-template-columns: minmax(0, 1fr) 9rem; gap: 0.75rem; align-items: center; margin: 0.65rem 0.7rem 0; padding: 0.52rem 0.65rem; color: #fff; background: #296ef7; font-size: 0.78rem; font-weight: 800; }
.performance-self-total strong { text-align: center; }
.performance-self-suggestion { display: grid; gap: 0.2rem; max-width: 46rem; margin: 0.9rem 0.7rem 0; }
.performance-self-suggestion small { color: var(--color-muted); font-size: 0.74rem; }
.performance-self-suggestion textarea { resize: vertical; }
.performance-self-form .performance-rubric-submit,
.performance-self-form > .empty-state { margin: 0.8rem 0.7rem 0.95rem; }
.performance-score-table-wrap { margin: 0 0.7rem; }
.performance-score-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; line-height: 1.35; }
.performance-score-table th,
.performance-score-table td { padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: middle; }
.performance-score-table thead th { color: #3d4654; background: #f7f9fc; font-size: 0.8rem; font-weight: 800; }
.performance-score-table thead th:last-child,
.performance-score-table td:last-child { width: 10rem; text-align: center; }
.performance-score-category th,
.performance-score-question th,
.performance-score-question td { color: #fff; background: #629fa1; }
.performance-score-category th { font-weight: 800; }
.performance-score-question th { border-top: 1px solid rgba(255, 255, 255, 0.45); font-weight: 650; }
.performance-score-option-row td:first-child { white-space: pre-line; }
.performance-score-option-row:hover td { background: rgba(98, 159, 161, 0.07); }
.performance-score-option-row:has(input:checked) td { color: #173e44; background: rgba(98, 159, 161, 0.13); font-weight: 700; }
.performance-score-option-row input { width: 1rem; height: 1rem; margin: 0; accent-color: #4f9194; }
.performance-score-option-row input:disabled { cursor: default; }
.performance-score-total th,
.performance-score-total td { color: #fff; background: #296ef7; font-weight: 800; }
.performance-bulk-evaluation { scroll-margin-top: 5.5rem; }
.performance-bulk-score-table { min-width: 42rem; }
.performance-bulk-score-table thead th:not(:first-child),
.performance-bulk-score-table td:not(:first-child) { width: 9.5rem; min-width: 9.5rem; text-align: center; }
.performance-bulk-score-table thead th:last-child,
.performance-bulk-score-table td:last-child { width: 9.5rem; text-align: center; }
.performance-bulk-score-table thead small { display: block; margin-top: 0.12rem; color: var(--color-muted); font-size: 0.66rem; font-weight: 700; }
.performance-bulk-score-table .performance-score-option-row td:first-child { min-width: 23rem; }
.performance-bulk-score-table .performance-score-option-row td:not(:first-child) { padding: 0.36rem; }
.performance-bulk-score-table .performance-score-option-row:has(input:checked) td { color: var(--color-text); background: var(--color-surface); font-weight: inherit; }
.performance-bulk-score-table .performance-score-option-row td:has(input:checked) { color: #173e44; background: rgba(98, 159, 161, 0.18); font-weight: 800; }
.performance-bulk-individual-scores { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.65rem 1rem; margin: 0.8rem 0.7rem; padding: 0.65rem 0.75rem; border: 1px solid #d9e5f7; border-radius: 0.55rem; color: #31435f; background: #f6f9ff; }
.performance-bulk-individual-scores > div:first-child { display: grid; gap: 0.14rem; }
.performance-bulk-individual-scores strong { font-size: 0.78rem; }
.performance-bulk-individual-scores small { color: #53647e; font-size: 0.7rem; line-height: 1.3; }
.performance-evaluator-legend,
.performance-evaluator-score-list,
.performance-evaluator-option-list { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.3rem; }
.performance-evaluator-legend { justify-content: flex-end; }
.performance-evaluator-option-list { margin-top: 0.34rem; }
.performance-evaluator-legend-item { display: inline-flex; align-items: center; gap: 0.28rem; color: #44536a; font-size: 0.69rem; font-weight: 700; white-space: nowrap; }
.performance-evaluator-chip,
.performance-evaluator-score { display: inline-flex; align-items: center; justify-content: center; gap: 0.22rem; border: 1px solid hsl(var(--performance-evaluator-hue) 55% 52% / 0.58); border-radius: 999px; color: hsl(var(--performance-evaluator-hue) 48% 25%); background: hsl(var(--performance-evaluator-hue) 72% 91%); font-size: 0.67rem; font-weight: 850; line-height: 1; }
.performance-evaluator-chip { min-width: 1.7rem; min-height: 1.35rem; padding: 0.18rem 0.35rem; }
.performance-evaluator-score { min-height: 1.45rem; padding: 0.17rem 0.34rem; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.34); }
.performance-evaluator-score.is-self { border-style: dashed; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.7); }
.performance-evaluator-score small { color: inherit; font-size: 0.57rem; font-weight: 900; letter-spacing: 0.025em; text-transform: uppercase; }
.performance-score-question td .performance-evaluator-empty { display: block; color: rgb(255 255 255 / 0.8); font-size: 0.65rem; font-style: italic; line-height: 1.25; }
.performance-evaluator-empty { color: #61718a; font-size: 0.7rem; }
.performance-results-panel { margin-top: 1.4rem; }
.performance-results-header { align-items: flex-end; }
.performance-results-header > div { min-width: 0; max-width: 64rem; }
.performance-results-note { max-width: 58rem; }
.performance-results-table-wrap { max-width: 100%; margin-top: 0.1rem; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; }
.data-table.performance-results-table { min-width: 75rem; table-layout: fixed; }
.performance-results-table th:nth-child(1) { width: 16%; }
.performance-results-table th:nth-child(2) { width: 10%; }
.performance-results-table th:nth-child(3) { width: 12%; }
.performance-results-table th:nth-child(4),
.performance-results-table th:nth-child(5),
.performance-results-table th:nth-child(6) { width: 7%; }
.performance-results-table th:nth-child(7) { width: 9%; }
.performance-results-table th:nth-child(8) { width: 7%; }
.performance-results-table th:nth-child(9),
.performance-results-table th:nth-child(10) { width: 8%; }
.performance-results-table th:nth-child(11) { width: 9%; }
.performance-results-table th,
.performance-results-table td { vertical-align: middle; }
.performance-results-table th:nth-child(n + 3),
.performance-results-table .performance-result-number { text-align: right; white-space: nowrap; }
.performance-results-table td small { display: block; margin-top: 0.24rem; color: var(--color-muted); font-size: 0.68rem; line-height: 1.3; white-space: normal; }
.performance-result-person { min-width: 0; }
.performance-result-person > strong { display: block; overflow-wrap: anywhere; }
.performance-result-person .status-pill { margin: 0 0.28rem 0.18rem 0; vertical-align: middle; }
.performance-result-role { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.performance-result-component strong { color: var(--color-text); }
.performance-result-score strong { color: var(--color-primary-strong); }
.performance-result-prize { background: color-mix(in srgb, var(--color-primary) 12%, transparent); }
.performance-result-prize strong { color: var(--color-primary-strong); font-size: 0.9rem; }
body.theme-contrast .performance-result-prize { outline: 2px solid var(--color-text); outline-offset: -2px; }
.performance-unavailable { border-left: 3px solid var(--color-primary); }

@media (max-width: 1080px) {
  .performance-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .performance-deviation-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .performance-assessment-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .performance-question { grid-template-columns: minmax(0, 1fr) 8rem; }
  .performance-comment { grid-column: 1 / -1; }
  .performance-relation-selects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .performance-cycle-summary, .performance-metric-grid, .performance-assignment-cards { grid-template-columns: minmax(0, 1fr); }
  .performance-disclosure-summary { align-items: stretch; }
  .performance-disclosure-summary .performance-status { justify-items: start; }
  .performance-cycle-select { width: 100%; }
  .performance-metric-section > .panel-header { align-items: start; }
  .performance-metric-section > .panel-header p:last-child { text-align: left; }
  .performance-management-actions, .performance-inline-form { align-items: stretch; }
  .performance-inline-form .field, .performance-inline-form .button, .performance-action-form, .performance-action-form .button { width: 100%; }
  .performance-eligibility-heading, .performance-eligibility-person { align-items: stretch; flex-direction: column; }
  .performance-eligibility-count, .performance-eligibility-locked { align-self: start; }
  .performance-question { grid-template-columns: minmax(0, 1fr); }
  .performance-comment { grid-column: auto; }
  .performance-deviation-list { grid-template-columns: minmax(0, 1fr); }
  .performance-self-page-heading { align-items: stretch; flex-direction: column; }
  .performance-self-page-heading .button { align-self: start; }
  .performance-self-option { grid-template-columns: minmax(0, 1fr) 2rem; font-size: 0.75rem; }
  .performance-self-total { grid-template-columns: minmax(0, 1fr) 5.8rem; }
  .performance-score-table { min-width: 33rem; }
  .performance-bulk-selector-actions { align-items: stretch; flex-direction: column; }
  .performance-bulk-selector-actions .button { width: 100%; }
  .performance-assessment-status-grid { grid-template-columns: minmax(0, 1fr); }
  .performance-relation-editor-heading { align-items: start; flex-direction: column; }
  .performance-relation-editor-heading p { text-align: left; }
  .performance-relation-selects { grid-template-columns: minmax(0, 1fr); }
  .data-table.performance-results-table { min-width: 72rem; }
}

/* Prémio trimestral: página de consulta autónoma, com os mesmos cálculos da
   avaliação mas sem misturar administração nem formulários de preenchimento. */
.quarterly-prize-hero { overflow: hidden; border-top: 3px solid var(--color-primary); }
.quarterly-prize-hero h2 { margin: 0.1rem 0 0.35rem; }
.quarterly-prize-hero .panel-header { align-items: flex-end; }
.quarterly-prize-hero .panel-header > div { max-width: 52rem; }
.quarterly-prize-filter-form { display: flex; align-items: end; flex-wrap: wrap; gap: 0.5rem; }
.quarterly-prize-filter-form .field { min-width: 12.5rem; margin: 0; }
.quarterly-prize-cycle-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin: 1rem 0; border: 1px solid var(--color-border); border-radius: 0.65rem; background: var(--color-border); }
.quarterly-prize-cycle-summary > div { display: grid; align-content: start; gap: 0.28rem; min-height: 4.8rem; padding: 0.85rem 0.95rem; background: var(--color-panel); }
.quarterly-prize-cycle-summary span { color: var(--color-muted); font-size: 0.69rem; font-weight: 800; letter-spacing: 0.045em; text-transform: uppercase; }
.quarterly-prize-cycle-summary strong { font-size: 0.88rem; }
.quarterly-prize-person-panel,
.quarterly-prize-indicators-panel,
.quarterly-prize-projects-panel,
.quarterly-prize-noneligible-panel { margin-top: 1rem; }
.quarterly-prize-person-panel .panel-header { margin-bottom: 1rem; }
.quarterly-prize-person-panel .panel-header h3 { margin: 0.1rem 0 0.2rem; }
.quarterly-prize-person-panel .panel-header p:not(.eyebrow) { margin-bottom: 0; color: var(--color-muted); }
.quarterly-prize-amounts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--color-border); border-radius: 0.65rem; background: var(--color-border); }
.quarterly-prize-amounts article { display: grid; align-content: start; gap: 0.42rem; min-height: 5.3rem; padding: 0.85rem; background: var(--color-surface); }
.quarterly-prize-amounts span { color: var(--color-muted); font-size: 0.71rem; font-weight: 750; line-height: 1.3; }
.quarterly-prize-amounts strong { font-size: 1.25rem; line-height: 1.1; }
.quarterly-prize-amounts .is-total { color: #fff; background: #296ef7; }
.quarterly-prize-amounts .is-total span { color: rgba(255, 255, 255, 0.82); }
.quarterly-prize-person-context { margin: 0.4rem 0 0; color: var(--color-muted); font-size: 0.73rem; }
.quarterly-prize-breakdown { margin-top: 0.8rem; border-top: 1px solid var(--color-border); }
.quarterly-prize-breakdown > summary { padding: 0.75rem 0 0; cursor: pointer; color: var(--color-muted); font-size: 0.76rem; font-weight: 800; }
.quarterly-prize-breakdown-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin-top: 0.7rem; border: 1px solid var(--color-border); border-radius: 0.55rem; background: var(--color-border); }
.quarterly-prize-breakdown-grid article { display: grid; align-content: start; gap: 0.26rem; padding: 0.68rem; background: var(--color-surface); }
.quarterly-prize-breakdown-grid span { color: var(--color-muted); font-size: 0.68rem; font-weight: 700; line-height: 1.3; }
.quarterly-prize-breakdown-grid strong { font-size: 0.8rem; }
.quarterly-prize-breakdown-grid b { color: var(--color-primary-strong); font-size: 0.76rem; }
.quarterly-prize-indicators-panel > .panel-header { margin-bottom: 0.9rem; }
.quarterly-prize-indicator-section + .quarterly-prize-indicator-section { margin-top: 1rem; }
.quarterly-prize-indicator-section > h4 { margin: 0 0 0.55rem; padding: 0.5rem 0.65rem; color: #fff; border-radius: 0.42rem; background: #5f9ea0; font-size: 0.76rem; line-height: 1.25; }
.quarterly-prize-indicator-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; }
.quarterly-prize-indicator { display: grid; grid-template-rows: auto auto 6px auto auto; gap: 0.55rem; min-width: 0; padding: 0.82rem; border: 1px solid var(--color-border); border-radius: 0.6rem; background: var(--color-surface); }
.quarterly-prize-indicator > div { display: flex; justify-content: space-between; align-items: start; gap: 0.5rem; }
.quarterly-prize-indicator > div strong { font-size: 0.77rem; line-height: 1.35; }
.quarterly-prize-indicator > div span { flex: 0 0 auto; color: #9a5b10; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.035em; text-transform: uppercase; }
.quarterly-prize-indicator.is-passed > div span { color: #067647; }
.quarterly-prize-indicator > b { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.38rem; font-size: 1.35rem; line-height: 1; }
.quarterly-prize-indicator-prize { color: var(--color-primary-strong); font-size: 0.82rem; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.quarterly-prize-indicator progress { display: block; width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: 99px; color: #c7771f; background: rgba(83, 122, 155, 0.2); appearance: none; -webkit-appearance: none; }
.quarterly-prize-indicator progress::-webkit-progress-bar { border-radius: inherit; background: rgba(83, 122, 155, 0.2); }
.quarterly-prize-indicator progress::-webkit-progress-value,
.quarterly-prize-indicator progress::-moz-progress-bar { border-radius: inherit; background: currentColor; }
.quarterly-prize-indicator.is-passed progress { color: #16a36a; }
.quarterly-prize-indicator small { color: var(--color-muted); font-size: 0.68rem; line-height: 1.35; }
.quarterly-prize-indicator-formula { padding-top: 0.38rem; border-top: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent); }
.quarterly-prize-quality { margin-top: 0.85rem; border-top: 1px solid var(--color-border); }
.quarterly-prize-quality > summary { padding: 0.8rem 0; cursor: pointer; color: var(--color-muted); font-size: 0.78rem; font-weight: 750; }
.quarterly-prize-person-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.quarterly-prize-person-detail-grid .panel-header { margin-bottom: 0.85rem; }
.quarterly-prize-time { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.55rem 0.75rem; }
.quarterly-prize-time > strong { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.45rem; font-size: 1.65rem; line-height: 1; }
.quarterly-prize-time .quarterly-prize-indicator-prize { font-size: 0.9rem; }
.quarterly-prize-time > small { grid-column: 1 / -1; color: var(--color-muted); font-size: 0.72rem; line-height: 1.4; }
.quarterly-prize-behaviour-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--color-border); border-radius: 0.55rem; background: var(--color-border); }
.quarterly-prize-behaviour-summary { display: grid; gap: 0.3rem; margin-bottom: 0.7rem; }
.quarterly-prize-behaviour-summary strong { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.4rem; font-size: 1rem; }
.quarterly-prize-behaviour-summary small { color: var(--color-muted); font-size: 0.69rem; }
.quarterly-prize-behaviour-imported { margin: 0; color: var(--color-muted); font-size: 0.75rem; line-height: 1.45; }
.quarterly-prize-behaviour-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.18rem 0.65rem; padding: 0.7rem 0.75rem; background: var(--color-surface); }
.quarterly-prize-behaviour-list span { color: var(--color-muted); font-size: 0.76rem; font-weight: 700; }
.quarterly-prize-behaviour-list strong { font-size: 0.95rem; }
.quarterly-prize-behaviour-list small { grid-column: 1 / -1; color: var(--color-muted); font-size: 0.67rem; }
.quarterly-prize-projects-panel,
.quarterly-prize-noneligible-panel { overflow: hidden; }
.quarterly-prize-projects-panel > summary,
.quarterly-prize-noneligible-panel > summary { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 0.9rem 2.35rem 0.9rem 1rem; cursor: pointer; list-style: none; }
.quarterly-prize-projects-panel > summary::-webkit-details-marker,
.quarterly-prize-noneligible-panel > summary::-webkit-details-marker { display: none; }
.quarterly-prize-projects-panel > summary::after,
.quarterly-prize-noneligible-panel > summary::after { content: '⌄'; position: absolute; top: 50%; right: 0.85rem; color: var(--color-muted); font-size: 1.1rem; font-weight: 800; line-height: 1; transform: translateY(-58%); transition: transform 160ms ease; }
.quarterly-prize-projects-panel[open] > summary::after,
.quarterly-prize-noneligible-panel[open] > summary::after { transform: translateY(-42%) rotate(180deg); }
.quarterly-prize-projects-panel > summary > span:first-child,
.quarterly-prize-noneligible-panel > summary > span:first-child { display: grid; min-width: 0; gap: 0.18rem; }
.quarterly-prize-projects-panel summary .eyebrow { margin: 0; }
.quarterly-prize-projects-panel summary > span:first-child > strong,
.quarterly-prize-noneligible-panel summary strong { font-size: 0.93rem; }
.quarterly-prize-projects-panel summary small,
.quarterly-prize-noneligible-panel summary small { color: var(--color-muted); font-size: 0.71rem; line-height: 1.35; }
.quarterly-prize-project-total { display: grid; justify-items: end; gap: 0.14rem; min-width: 9.5rem; text-align: right; }
.quarterly-prize-project-total b { color: var(--color-muted); font-size: 0.68rem; font-weight: 750; }
.quarterly-prize-project-total strong { color: var(--color-primary-strong); font-size: 0.95rem; white-space: nowrap; }
.quarterly-prize-projects-panel > div,
.quarterly-prize-noneligible-panel > div { padding: 0 1rem 1rem; border-top: 1px solid var(--color-border); }
.quarterly-prize-projects-panel > div .table-responsive,
.quarterly-prize-noneligible-panel > div .table-responsive { margin-top: 0.85rem; }
.quarterly-prize-project-table-wrap { max-width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; }
.quarterly-prize-project-table { width: 100%; min-width: 130rem; table-layout: fixed; }
.quarterly-prize-project-table--without-financials { min-width: 101rem; }
.quarterly-prize-project-table--without-margins { min-width: 115.5rem; }
.quarterly-prize-project-table--without-financials.quarterly-prize-project-table--without-margins { min-width: 86.5rem; }
.quarterly-prize-project-table .quarterly-prize-project-col-reference { width: 7.25rem; }
.quarterly-prize-project-table .quarterly-prize-project-col-requester { width: 14rem; }
.quarterly-prize-project-table .quarterly-prize-project-col-money { width: 7.5rem; }
.quarterly-prize-project-table .quarterly-prize-project-col-date { width: 5.75rem; }
.quarterly-prize-project-table .quarterly-prize-project-col-time { width: 5.75rem; }
.quarterly-prize-project-table .quarterly-prize-project-col-ratio { width: 6.5rem; }
.quarterly-prize-project-table .quarterly-prize-project-col-margin { width: 7.25rem; }
.quarterly-prize-project-table .quarterly-prize-project-col-deviation { width: 6.5rem; }
.quarterly-prize-project-table .quarterly-prize-project-col-indicator { width: 3.75rem; }
.quarterly-prize-project-table .quarterly-prize-project-col-status { width: 9.5rem; }
.quarterly-prize-project-table th { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; padding: 0.62rem 0.45rem; font-size: 0.67rem; vertical-align: bottom; }
.quarterly-prize-column-tooltip { position: relative; display: inline-flex; max-width: 100%; }
.quarterly-prize-column-tooltip-trigger { display: inline-flex; align-items: flex-start; gap: 0.2rem; min-width: 0; max-width: 100%; margin: 0; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; font-weight: inherit; line-height: inherit; text-align: inherit; cursor: help; }
.quarterly-prize-column-tooltip-trigger > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.quarterly-prize-column-tooltip-icon { display: inline-grid; flex: 0 0 auto; place-items: center; width: 1.02rem; height: 1.02rem; margin-top: -0.04rem; border: 1px solid currentColor; border-radius: 50%; color: var(--color-primary-strong); font-size: 0.65rem; font-style: normal; font-weight: 900; line-height: 1; }
.quarterly-prize-column-tooltip-trigger:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 0.14rem; border-radius: 0.16rem; }
.quarterly-prize-column-tooltip-content { position: absolute; z-index: 90; inset-block-start: calc(100% + 0.46rem); inset-inline-start: 0; display: grid; width: max-content; max-width: min(23rem, calc(100vw - 2rem)); gap: 0.3rem; padding: 0.68rem 0.72rem; border: 1px solid var(--color-border); border-radius: 0.45rem; color: var(--color-text); background: var(--color-surface-elevated); box-shadow: var(--shadow-soft); font-size: 0.72rem; font-weight: 500; line-height: 1.38; text-align: left; opacity: 0; pointer-events: none; transform: translateY(-0.18rem); transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease; visibility: hidden; }
.quarterly-prize-column-tooltip-content strong { color: var(--color-text); font-size: 0.74rem; }
.quarterly-prize-column-tooltip-content span { color: var(--color-muted); }
.quarterly-prize-column-tooltip:focus-within .quarterly-prize-column-tooltip-content { opacity: 1; transform: translateY(0); visibility: visible; }
@media (hover: hover) and (pointer: fine) {
  .quarterly-prize-column-tooltip:hover .quarterly-prize-column-tooltip-content { opacity: 1; transform: translateY(0); visibility: visible; }
}
.quarterly-prize-project-table th:nth-last-child(-n + 6) .quarterly-prize-column-tooltip-content { inset-inline-start: auto; inset-inline-end: 0; }
.quarterly-prize-project-table td { white-space: nowrap; padding-right: 0.45rem; padding-left: 0.45rem; }
.quarterly-prize-project-table .quarterly-prize-project-requester {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.quarterly-prize-project-reference { color: var(--color-text); font-weight: 750; }
.quarterly-prize-project-table .quarterly-prize-numeric { text-align: right; }
.quarterly-prize-project-table .quarterly-prize-numeric.is-positive { color: #067647; font-weight: 750; }
.quarterly-prize-project-table .quarterly-prize-numeric.is-attention { color: #9a3412; background: rgba(234, 88, 12, 0.08); font-weight: 750; }
.quarterly-prize-project-table td:last-child,
.quarterly-prize-project-table th:last-child { text-align: center; }
.quarterly-prize-project-table td:last-child { white-space: normal; line-height: 1.25; }
body.theme-contrast .quarterly-prize-column-tooltip-icon,
body.theme-contrast .quarterly-prize-column-tooltip-content { border-width: 2px; }
body.theme-contrast .quarterly-prize-column-tooltip-icon { color: var(--color-text); }

@media (max-width: 980px) {
  .quarterly-prize-hero .panel-header { align-items: stretch; }
  .quarterly-prize-indicator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quarterly-prize-amounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quarterly-prize-breakdown-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .quarterly-prize-filter-form { align-items: stretch; }
  .quarterly-prize-filter-form .field,
  .quarterly-prize-filter-form .button { width: 100%; }
  .quarterly-prize-cycle-summary,
  .quarterly-prize-amounts,
  .quarterly-prize-breakdown-grid,
  .quarterly-prize-indicator-grid,
  .quarterly-prize-person-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .quarterly-prize-projects-panel > summary,
  .quarterly-prize-noneligible-panel > summary { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .quarterly-prize-project-total { justify-items: start; min-width: 0; text-align: left; }
}

/* Análise Financeira / Rentabilidade — mesma base de cálculo do OrgBI
   anterior, apresentada com os componentes e temas do CRM reconstruído. */
.financial-filter-form {
  grid-template-columns: minmax(16rem, 1.25fr) repeat(2, minmax(9rem, .7fr)) repeat(4, minmax(10rem, 1fr)) auto;
}

.financial-period-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  min-height: 42px;
  margin: 0;
  padding: .42rem .6rem .5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
}

.financial-period-picker legend {
  padding: 0 .22rem;
  color: var(--color-muted);
  font-size: .68rem;
  font-weight: 800;
}

.financial-period-picker label {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  color: var(--color-text);
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
}

.financial-period-picker input { accent-color: var(--color-primary); }

.financial-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.financial-summary-panel,
.financial-distribution-panel { border-top: 3px solid var(--color-primary); }

.financial-distribution-panel { border-top-color: var(--color-accent); }

.financial-summary-panel .panel-header,
.financial-distribution-panel .panel-header,
.financial-report-panel .panel-header { margin-bottom: .85rem; }

.financial-summary-panel .panel-header p,
.financial-distribution-panel .panel-header p,
.financial-report-panel .panel-header p {
  margin: .22rem 0 0;
  color: var(--color-muted);
  font-size: .78rem;
}

.financial-total-list {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--color-border);
}

.financial-total-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  padding: .53rem .08rem;
  border-bottom: 1px solid var(--color-border);
}

.financial-total-list dt {
  color: var(--color-muted);
  font-size: .78rem;
  font-weight: 700;
}

.financial-total-list dd {
  margin: 0;
  color: var(--color-text);
  font-size: .86rem;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.financial-value-warning { color: #af6a11 !important; }
.financial-value-negative { color: var(--color-danger) !important; font-weight: 850 !important; }

.financial-distribution { display: grid; gap: .62rem; padding-top: .22rem; }

.financial-distribution-row {
  display: grid;
  grid-template-columns: minmax(7.4rem, .8fr) minmax(4rem, 2fr) 1.5rem;
  gap: .58rem;
  align-items: center;
}

.financial-distribution-row > span {
  color: var(--color-muted);
  font-size: .75rem;
  font-weight: 700;
}

.financial-distribution-row > strong { font-size: .78rem; text-align: right; }

.financial-distribution-track {
  height: .7rem;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface-soft);
}

.financial-distribution-track svg {
  display: block;
  height: 100%;
  width: 100%;
}

.financial-distribution-fill { fill: currentColor; }
.financial-distribution-fill.is-danger { color: var(--color-danger); }
.financial-distribution-fill.is-warning { color: var(--color-warning); }
.financial-distribution-fill.is-primary { color: var(--color-primary); }
.financial-distribution-fill.is-accent { color: var(--color-accent); }
.financial-distribution-fill.is-success { color: var(--color-success); }

.financial-report-panel { overflow: hidden; }
.financial-table-scroll { overflow: auto; overscroll-behavior-inline: contain; }

.financial-data-table { min-width: 68rem; table-layout: auto; }
.financial-data-table th,
.financial-data-table td { padding: .56rem .52rem; }
.financial-data-table th { white-space: normal; }
.table-sort-button,
.financial-sort-button {
  align-items: flex-start;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: inherit;
  cursor: pointer;
}
.table-sort-button > span:first-child,
.financial-sort-button > span:first-child { min-width: 0; }
.table-sort-button:hover,
.table-sort-button:focus-visible,
.financial-sort-button:hover,
.financial-sort-button:focus-visible { color: var(--color-primary-strong); }
.table-sort-button:focus-visible,
.financial-sort-button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; border-radius: 2px; }
.financial-expand-heading,
.financial-data-table > tbody > .financial-row > td:first-child { width: 2.7rem; text-align: center; }
.financial-data-table .financial-money { text-align: right; white-space: nowrap; }

.financial-expand-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-accent);
  background: var(--color-surface-elevated);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

.financial-expand-button:hover,
.financial-expand-button:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-surface);
  background: var(--color-accent);
}

.financial-expand-button:disabled { cursor: wait; opacity: .65; }

.financial-comparison-cell > span {
  display: block;
  min-width: max-content;
  line-height: 1.42;
}

.financial-comparison-cell > span + span { margin-top: .12rem; }

.financial-profit {
  display: inline-grid;
  justify-items: end;
  gap: .1rem;
  min-width: 6rem;
  padding: .22rem .35rem;
  border-radius: .35rem;
  color: #14704d;
  background: color-mix(in srgb, #2c9569 12%, transparent);
  font-weight: 800;
}

.financial-profit small { color: inherit; font-size: .67rem; font-weight: 750; }

.financial-profit-negative {
  color: var(--color-danger);
  background: color-mix(in srgb, var(--color-danger) 14%, transparent);
}

.financial-data-table tfoot th {
  border-top: 2px solid var(--color-border);
  color: var(--color-text);
  background: var(--color-surface-soft);
}

.financial-table-note {
  margin: .78rem 0 0;
  color: var(--color-muted);
  font-size: .74rem;
}

.financial-detail-row > td {
  padding: 0 !important;
  background: var(--color-surface-elevated) !important;
}

.financial-detail-row-error > td {
  padding: .85rem 1rem !important;
  color: var(--color-danger);
}

.financial-details {
  display: grid;
  gap: .8rem;
  padding: 1rem;
  border-top: 2px solid var(--color-accent);
}

.financial-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
}

.financial-details-header h3 { margin: 0; }
.financial-details-header p { margin: .2rem 0 0; color: var(--color-muted); font-size: .78rem; }
.financial-detail-table-scroll { overflow: auto; overscroll-behavior-inline: contain; }
.financial-detail-table { min-width: 40rem; font-size: .77rem; }
.financial-detail-table th,
.financial-detail-table td { padding: .45rem .5rem; }

/* Prestadores externos / notas de pagamento — lógica e informação do OrgBI
   anterior, usando os cartões, cores e densidade do CRM atual. */
.provider-payments-filter-form {
  grid-template-columns: minmax(16rem, 1.2fr) repeat(2, minmax(9rem, .7fr)) repeat(2, minmax(11rem, 1fr)) auto;
}

.provider-payments-period-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  min-height: 42px;
  margin: 0;
  padding: .42rem .6rem .5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
}

.provider-payments-period-picker legend {
  padding: 0 .22rem;
  color: var(--color-muted);
  font-size: .68rem;
  font-weight: 800;
}

.provider-payments-period-picker label {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  color: var(--color-text);
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
}

.provider-payments-period-picker input { accent-color: var(--color-primary); }

.provider-payments-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin: 1.2rem 0 .8rem;
}

.provider-payments-heading h2 { margin: 0; }
.provider-payments-heading p { margin: .3rem 0 0; color: var(--color-muted); }
.provider-payments-heading > span { color: var(--color-muted); font-size: .82rem; font-weight: 750; white-space: nowrap; }

.provider-payments-groups { display: grid; gap: 1rem; }
.provider-payment-group { overflow: hidden; border-top: 3px solid var(--color-primary); }

.provider-payment-group-header {
  display: flex;
  align-items: center;
  min-height: 3.8rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

.provider-payment-group-header h3 { margin: 0; font-size: 1rem; }
.provider-payment-group-header p { margin: .2rem 0 0; color: var(--color-muted); font-size: .78rem; }
.provider-payment-table-scroll { overflow: auto; overscroll-behavior-inline: contain; }
.provider-payment-table { min-width: 76rem; }
.provider-payment-table th,
.provider-payment-table td { padding: .56rem .6rem; vertical-align: middle; }
.provider-payment-table th { white-space: normal; }
.provider-payment-select-heading,
.provider-payment-select-cell { width: 3.75rem; text-align: center; }
.provider-payment-select-cell input { inline-size: 1rem; block-size: 1rem; accent-color: var(--color-primary); cursor: pointer; }
.provider-payment-select-cell input:disabled { cursor: not-allowed; opacity: .42; }
.provider-payment-unavailable { color: var(--color-muted); }
.provider-payment-money { text-align: right; white-space: nowrap; }

.provider-payment-received {
  font-weight: 800;
  background-clip: padding-box;
}

.provider-payment-received.is-complete {
  color: #11734d;
  background: color-mix(in srgb, #229b6e 15%, var(--color-surface-elevated));
}

.provider-payment-received.is-pending {
  color: var(--color-danger);
  background: color-mix(in srgb, var(--color-danger) 14%, var(--color-surface-elevated));
}

.provider-payment-table tfoot th {
  border-top: 2px solid var(--color-border);
  color: var(--color-text);
  background: var(--color-surface-soft);
}

.provider-payment-selection-bar {
  position: sticky;
  bottom: 1rem;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: .78rem .9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px color-mix(in srgb, #000 16%, transparent);
  background: var(--color-surface-elevated);
}

.provider-payment-selection-bar p { margin: 0; color: var(--color-text); font-size: .84rem; font-weight: 700; }

.payment-note-invoice-field {
  flex: 0 1 15rem;
  min-width: 11rem;
  margin: 0;
}

.payment-note-invoice-field .field-label { font-size: .7rem; }
.payment-note-invoice-field input { min-height: 2.25rem; font-size: .8rem; }

/* Angariadores/comissionistas — a mesma leitura por pessoa do OrgBI anterior,
   usando os componentes e os temas da reconstrução. */
.agent-payments-filter-form {
  grid-template-columns: minmax(16rem, 1.15fr) repeat(2, minmax(9rem, .7fr)) repeat(2, minmax(11rem, 1fr)) auto;
}

.agent-payments-period-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  min-height: 42px;
  margin: 0;
  padding: .42rem .6rem .5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
}

.agent-payments-period-picker legend {
  padding: 0 .22rem;
  color: var(--color-muted);
  font-size: .68rem;
  font-weight: 800;
}

.agent-payments-period-picker label {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  color: var(--color-text);
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
}

.agent-payments-period-picker input { accent-color: var(--color-primary); }

.agent-payments-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin: 1.2rem 0 .8rem;
}

.agent-payments-heading h2 { margin: 0; }
.agent-payments-heading p { margin: .3rem 0 0; color: var(--color-muted); }
.agent-payments-heading > span { color: var(--color-muted); font-size: .82rem; font-weight: 750; white-space: nowrap; }

.agent-payments-groups { display: grid; gap: 1rem; }
.agent-payment-group { overflow: hidden; border-top: 3px solid var(--color-primary); }

.agent-payment-group-header {
  display: flex;
  align-items: center;
  min-height: 3.8rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

.agent-payment-group-header h3 { margin: 0; font-size: 1rem; }
.agent-payment-group-header p { margin: .2rem 0 0; color: var(--color-muted); font-size: .78rem; }
.agent-payment-table-scroll { overflow: auto; overscroll-behavior-inline: contain; }
.agent-payment-table { min-width: 59rem; }
.agent-payment-table th,
.agent-payment-table td { padding: .56rem .6rem; vertical-align: middle; }
.agent-payment-select-heading,
.agent-payment-select-cell { width: 3.75rem; text-align: center; }
.agent-payment-select-cell input { inline-size: 1rem; block-size: 1rem; accent-color: var(--color-primary); cursor: pointer; }
.agent-payment-unavailable { color: var(--color-muted); }
.agent-payment-money { text-align: right; white-space: nowrap; }

.agent-payment-received {
  font-weight: 800;
  background-clip: padding-box;
}

.agent-payment-received.is-complete {
  color: #11734d;
  background: color-mix(in srgb, #229b6e 15%, var(--color-surface-elevated));
}

.agent-payment-received.is-pending {
  color: var(--color-danger);
  background: color-mix(in srgb, var(--color-danger) 14%, var(--color-surface-elevated));
}

.agent-payment-table tfoot th {
  border-top: 2px solid var(--color-border);
  color: var(--color-text);
  background: var(--color-surface-soft);
}

.agent-payment-selection-bar {
  position: sticky;
  bottom: 1rem;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: .78rem .9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px color-mix(in srgb, #000 16%, transparent);
  background: var(--color-surface-elevated);
}

.agent-payment-selection-bar p { margin: 0; color: var(--color-text); font-size: .84rem; font-weight: 700; }

/* Notas de pagamento de prestadores — mesma organização do OrgBI anterior,
   sem recuperar o estilo antigo e com ações acessíveis do CRM atual. */
.provider-notes-filter-form {
  grid-template-columns: minmax(16rem, 1.15fr) repeat(2, minmax(9rem, .7fr)) repeat(2, minmax(11rem, 1fr)) auto;
}

.provider-notes-period-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  min-height: 42px;
  margin: 0;
  padding: .42rem .6rem .5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
}

.provider-notes-period-picker legend {
  padding: 0 .22rem;
  color: var(--color-muted);
  font-size: .68rem;
  font-weight: 800;
}

.provider-notes-period-picker label {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  color: var(--color-text);
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
}

.provider-notes-period-picker input { accent-color: var(--color-primary); }

.provider-notes-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin: 1.2rem 0 .8rem;
}

.provider-notes-heading h2 { margin: 0; }
.provider-notes-heading p { margin: .3rem 0 0; color: var(--color-muted); }
.provider-notes-heading > span { color: var(--color-muted); font-size: .82rem; font-weight: 750; white-space: nowrap; }

.provider-notes-groups { display: grid; gap: 1rem; }
.provider-note-group { overflow: hidden; border-top: 3px solid var(--color-accent); }

.provider-note-group-header {
  display: flex;
  align-items: center;
  min-height: 3.8rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

.provider-note-group-header h3 { margin: 0; font-size: 1rem; }
.provider-note-group-header p { margin: .2rem 0 0; color: var(--color-muted); font-size: .78rem; }
.provider-note-table-scroll { overflow: auto; overscroll-behavior-inline: contain; }
.provider-note-table { min-width: 57rem; }
.provider-note-table th,
.provider-note-table td { padding: .56rem .6rem; vertical-align: middle; }
.provider-note-action-heading,
.provider-note-action-cell { width: 3.1rem; text-align: center; }

.provider-note-pdf {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  margin-left: .42rem;
  padding: .12rem .34rem;
  border: 1px solid var(--color-border);
  border-radius: .3rem;
  color: var(--color-accent);
  background: var(--color-surface-soft);
  font-size: .64rem;
  font-weight: 850;
  letter-spacing: .035em;
  line-height: 1;
  text-decoration: none;
  transition: transform 160ms ease, color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.provider-note-pdf:hover,
.provider-note-pdf:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-surface);
  background: var(--color-accent);
  transform: translateY(-1px);
}

.provider-note-payment-date { font-weight: 750; white-space: nowrap; }
.provider-note-payment-date.is-complete { color: #11734d; }
.provider-note-payment-date.is-pending { color: var(--color-danger); }

/* Notas de comissão — usa a mesma hierarquia das notas de prestadores,
   com terminologia própria para facilitar a conferência financeira. */
.agent-notes-filter-form {
  grid-template-columns: minmax(16rem, 1.15fr) repeat(2, minmax(9rem, .7fr)) repeat(2, minmax(11rem, 1fr)) auto;
}

.agent-notes-period-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  min-height: 42px;
  margin: 0;
  padding: .42rem .6rem .5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
}

.agent-notes-period-picker legend {
  padding: 0 .22rem;
  color: var(--color-muted);
  font-size: .68rem;
  font-weight: 800;
}

.agent-notes-period-picker label {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  color: var(--color-text);
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
}

.agent-notes-period-picker input { accent-color: var(--color-primary); }

.agent-notes-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin: 1.2rem 0 .8rem;
}

.agent-notes-heading h2 { margin: 0; }
.agent-notes-heading p { margin: .3rem 0 0; color: var(--color-muted); }
.agent-notes-heading > span { color: var(--color-muted); font-size: .82rem; font-weight: 750; white-space: nowrap; }

.agent-notes-groups { display: grid; gap: 1rem; }
.agent-note-group { overflow: hidden; border-top: 3px solid var(--color-accent); }

.agent-note-group-header {
  display: flex;
  align-items: center;
  min-height: 3.8rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

.agent-note-group-header h3 { margin: 0; font-size: 1rem; }
.agent-note-group-header p { margin: .2rem 0 0; color: var(--color-muted); font-size: .78rem; }
.agent-note-table-scroll { overflow: auto; overscroll-behavior-inline: contain; }
.agent-note-table { min-width: 57rem; }
.agent-note-table th,
.agent-note-table td { padding: .56rem .6rem; vertical-align: middle; }
.agent-note-action-heading,
.agent-note-action-cell { width: 3.1rem; text-align: center; }

.agent-note-pdf {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  margin-left: .42rem;
  padding: .12rem .34rem;
  border: 1px solid var(--color-border);
  border-radius: .3rem;
  color: var(--color-accent);
  background: var(--color-surface-soft);
  font-size: .64rem;
  font-weight: 850;
  letter-spacing: .035em;
  line-height: 1;
  text-decoration: none;
  transition: transform 160ms ease, color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.agent-note-pdf:hover,
.agent-note-pdf:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-surface);
  background: var(--color-accent);
  transform: translateY(-1px);
}

.agent-note-payment-date { font-weight: 750; white-space: nowrap; }
.agent-note-payment-date.is-complete { color: #11734d; }
.agent-note-payment-date.is-pending { color: var(--color-danger); }
.agent-note-invoice-status { font-weight: 700; }
.agent-note-invoice-status.is-complete { color: #11734d; }
.agent-note-invoice-status.is-pending { color: var(--color-danger); }
.agent-note-invoice-status small { display: block; margin-top: .2rem; color: var(--color-muted); font-weight: 600; }
.agent-note-invoice-status .table-action { margin-left: .35rem; }

/* Cartões expansíveis das consultas. Todos começam fechados no
   HTML; o utilizador abre apenas a informação que precisa de consultar. */
.report-collapsible-card {
  padding: 0;
  overflow: hidden;
}

/* Project search results are positioned below the open report filter. The
   generic collapsible-card clipping is useful for report tables, but would
   hide this interactive list behind the cards that follow it. */
.report-filter-panel.report-collapsible-card[open] {
  position: relative;
  z-index: 30;
  overflow: visible;
}

.report-collapsible-card > summary {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .82rem 1rem;
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
}

.report-collapsible-card > summary::-webkit-details-marker { display: none; }

.report-collapsible-card > summary::before {
  content: '⌄';
  flex: 0 0 auto;
  color: var(--color-primary-strong);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  transition: transform .16s ease;
}

.report-collapsible-card:not([open]) > summary::before { transform: rotate(-90deg); }

.report-collapsible-card > summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-accent) 45%, transparent);
  outline-offset: -3px;
}

.report-collapsible-card-heading {
  display: grid;
  min-width: 0;
  gap: .16rem;
}

.report-collapsible-card-title {
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
}

.report-collapsible-card-description {
  overflow: hidden;
  color: var(--color-muted);
  font-size: .78rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-collapsible-card-state {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--color-muted);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.report-collapsible-card[open] > summary .report-collapsible-card-state { font-size: 0; }
.report-collapsible-card[open] > summary .report-collapsible-card-state::after {
  content: 'Fechar';
  font-size: .78rem;
}

.report-collapsible-card-content {
  padding: 1rem;
  border-top: 1px solid var(--color-border);
}

.report-collapsible-card-content-table { padding: 0; }

.provider-payment-group-header,
.agent-payment-group-header,
.provider-note-group-header,
.agent-note-group-header { border-bottom: 0; }

.provider-payment-group[open] > .provider-payment-group-header,
.agent-payment-group[open] > .agent-payment-group-header,
.provider-note-group[open] > .provider-note-group-header,
.agent-note-group[open] > .agent-note-group-header { border-bottom: 1px solid var(--color-border); }

@media (max-width: 1180px) {
  .financial-filter-form { grid-template-columns: repeat(4, minmax(10rem, 1fr)); }
  .financial-period-picker { grid-column: span 2; }
  .user-times-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .provider-payments-filter-form { grid-template-columns: repeat(4, minmax(10rem, 1fr)); }
  .provider-payments-period-picker { grid-column: span 2; }
  .agent-payments-filter-form { grid-template-columns: repeat(4, minmax(10rem, 1fr)); }
  .agent-payments-period-picker { grid-column: span 2; }
  .provider-notes-filter-form { grid-template-columns: repeat(4, minmax(10rem, 1fr)); }
  .provider-notes-period-picker { grid-column: span 2; }
  .agent-notes-filter-form { grid-template-columns: repeat(4, minmax(10rem, 1fr)); }
  .agent-notes-period-picker { grid-column: span 2; }
}

@media (max-width: 760px) {
  .financial-filter-form,
  .financial-summary-grid,
  .provider-payments-filter-form,
  .agent-payments-filter-form,
  .provider-notes-filter-form,
  .agent-notes-filter-form { grid-template-columns: minmax(0, 1fr); }
  .financial-period-picker,
  .provider-payments-period-picker,
  .agent-payments-period-picker,
  .provider-notes-period-picker,
  .agent-notes-period-picker { grid-column: auto; }
  .financial-filter-form .form-actions { justify-content: stretch; }
  .financial-filter-form .button { flex: 1 1 auto; }
  .financial-details-header { align-items: stretch; flex-direction: column; }
  .financial-details-header .button { align-self: start; }
  .provider-payments-heading,
  .agent-payments-heading,
  .provider-notes-heading,
  .agent-notes-heading,
  .provider-payment-selection-bar,
  .agent-payment-selection-bar { align-items: stretch; flex-direction: column; }
  .provider-payment-selection-bar .button,
  .agent-payment-selection-bar .button { width: 100%; }
  .payment-note-invoice-field { width: 100%; }
  .email-provider-invoice-next-step { grid-template-columns: 1fr; }
  .email-provider-invoice-next-step .button { width: 100%; }
  .email-payment-note-preview-header { align-items: stretch; flex-direction: column; }
  .email-payment-note-preview-actions .button { flex: 1 1 auto; }
  .email-payment-note-preview-frame { height: 60vh; min-height: 28rem; }
  .email-payment-note-validation-summary { grid-template-columns: 1fr; }
  .email-payment-note-validation-actions,
  .email-payment-note-validation-actions form { display: grid; width: 100%; }
  .email-payment-note-validation-actions .button { width: 100%; }
}

/* Modelos automáticos do compositor de emails. O cartão explica a origem do
   fluxo e dá ao administrador uma edição visual, sem obrigá-lo a escrever
   HTML para alterar a mensagem que os utilizadores recebem no compositor. */
.email-workflow-template-list { display: grid; gap: 0.7rem; }
.email-workflow-template { overflow: hidden; border: 1px solid var(--color-border); border-radius: 0.7rem; background: var(--color-surface); }
.email-workflow-template > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0.95rem; cursor: pointer; list-style: none; }
.email-workflow-template > summary::-webkit-details-marker,
.email-template-preview > summary::-webkit-details-marker { display: none; }
.email-workflow-template > summary::after,
.email-template-preview > summary::after { flex: 0 0 auto; content: '+'; color: var(--color-primary); font-weight: 900; font-size: 1rem; }
.email-workflow-template[open] > summary::after,
.email-template-preview[open] > summary::after { content: '−'; }
.email-workflow-template[open] > summary { border-bottom: 1px solid var(--color-border); background: var(--color-panel); }
.email-workflow-template-summary { display: grid; gap: 0.15rem; min-width: 0; }
.email-workflow-template-summary strong { font-size: 0.91rem; }
.email-workflow-template-summary small { color: var(--color-muted); font-size: 0.75rem; line-height: 1.35; }
.email-workflow-template-body { display: grid; gap: 0.8rem; padding: 0.9rem 0.95rem; }
.email-workflow-template-body > p { margin: 0; color: var(--color-muted); font-size: 0.81rem; line-height: 1.45; }
.email-workflow-template-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.78rem; }
.invoice-reminder-safety { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.75rem 0.85rem; border: 1px solid color-mix(in srgb, #d92d20 45%, var(--color-border)); border-radius: 0.65rem; color: var(--color-text); background: color-mix(in srgb, #d92d20 10%, var(--color-panel)); }
.invoice-reminder-safety strong { color: #c5271a; white-space: nowrap; }
.invoice-reminder-safety span { color: var(--color-muted); font-size: 0.84rem; line-height: 1.4; }
.invoice-reminder-safety.is-active { border-color: color-mix(in srgb, #16803c 42%, var(--color-border)); background: color-mix(in srgb, #16803c 11%, var(--color-panel)); }
.invoice-reminder-safety.is-active strong { color: #16803c; }
.invoice-reminder-settings-form { display: grid; gap: 1rem; }
.invoice-reminder-toggle { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.8rem 0.9rem; border: 1px solid var(--color-border); border-radius: 0.65rem; background: var(--color-panel); cursor: pointer; }
.invoice-reminder-toggle input { margin-top: 0.22rem; accent-color: var(--color-primary); }
.invoice-reminder-toggle span { display: grid; gap: 0.2rem; }
.invoice-reminder-toggle small, .invoice-reminder-delays small { color: var(--color-muted); font-size: 0.76rem; line-height: 1.4; }
.invoice-reminder-delays { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.invoice-reminder-delays .field { display: grid; gap: 0.35rem; padding: 0.75rem; border: 1px solid var(--color-border); border-radius: 0.65rem; background: var(--color-surface); }
.field-with-unit { display: flex; align-items: center; gap: 0.45rem; }
.field-with-unit input { min-width: 0; }
.field-with-unit span { color: var(--color-muted); font-size: 0.84rem; font-weight: 700; }
.invoice-reminder-notes { display: grid; gap: 0.42rem; padding: 0.75rem 0.85rem; border-left: 3px solid var(--color-primary); border-radius: 0 0.55rem 0.55rem 0; background: var(--color-surface); }
.invoice-reminder-notes p { margin: 0; color: var(--color-muted); font-size: 0.81rem; line-height: 1.45; }
.invoice-reminder-notes strong { color: var(--color-text); }
.invoice-reminder-notes a { color: var(--color-primary); font-weight: 750; }
.email-automatic-controls-list { display: grid; gap: 0.42rem; }
#email-automatic-controls .email-automatic-control-card { display: block; padding: 0; }
#email-automatic-controls .email-automatic-control-form { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0.6rem; padding: 0.48rem 0.62rem; }
#email-automatic-controls .email-automatic-control-identity { display: flex; align-items: baseline; min-width: 0; gap: 0.35rem; }
#email-automatic-controls .email-automatic-control-identity strong { flex: 0 0 auto; color: var(--color-text); font-size: 0.86rem; }
#email-automatic-controls .email-automatic-control-identity > span { min-width: 0; overflow: hidden; color: var(--color-muted); font-size: 0.8rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
#email-automatic-controls .email-automatic-control-switch { display: flex; align-items: center; gap: 0.38rem; white-space: nowrap; }
#email-automatic-controls .invoice-reminder-toggle { display: inline-flex; align-items: center; gap: 0.38rem; padding: 0; border: 0; border-radius: 0; background: transparent; }
#email-automatic-controls .invoice-reminder-toggle input { width: 1rem; height: 1rem; margin: 0; }
#email-automatic-controls .invoice-reminder-toggle span { display: inline; }
#email-automatic-controls .invoice-reminder-toggle strong { color: var(--color-text); font-size: 0.78rem; font-weight: 700; }
#email-automatic-controls .invoice-reminder-toggle small { display: none; }
#email-automatic-controls .email-automatic-control-help { display: inline-grid; flex: 0 0 auto; width: 1rem; height: 1rem; place-items: center; border: 1px solid currentColor; border-radius: 999px; color: var(--color-muted); font-size: 0.68rem; font-style: normal; font-weight: 800; line-height: 1; cursor: help; }
#email-automatic-controls .email-automatic-control-help:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
#email-automatic-controls .form-actions { margin: 0; }
#email-automatic-controls .form-actions .button { min-height: 2rem; padding: 0.34rem 0.62rem; font-size: 0.78rem; white-space: nowrap; }
@media (max-width: 780px) {
  #email-automatic-controls .email-automatic-control-form { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0.42rem; }
  #email-automatic-controls .email-automatic-control-identity { grid-column: 1 / -1; }
}
@media (max-width: 460px) {
  #email-automatic-controls .email-automatic-control-form { gap: 0.42rem; padding: 0.5rem; }
  #email-automatic-controls .email-automatic-control-identity { align-items: flex-start; flex-wrap: wrap; gap: 0.12rem 0.35rem; }
  #email-automatic-controls .email-automatic-control-identity > span { flex: 1 0 100%; white-space: normal; }
  #email-automatic-controls .invoice-reminder-toggle strong { font-size: 0.74rem; }
}
.email-workflow-template-form .field { margin: 0; }
.email-template-visual-field { display: grid; gap: 0.38rem; }
.email-template-visual-field > small { color: var(--color-muted); font-size: 0.72rem; line-height: 1.35; }
.email-template-visual-editor { min-height: 13rem; max-height: 31rem; overflow: auto; padding: 0.85rem; border: 1px solid var(--color-border); border-radius: 0.55rem; color: var(--color-text); background: var(--color-panel); line-height: 1.5; outline: 0; }
.email-template-visual-editor:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent); }
.email-template-visual-editor p:first-child { margin-top: 0; }
.email-template-visual-editor p:last-child { margin-bottom: 0; }
.email-template-visual-editor table { width: 100%; border-collapse: collapse; }
.email-template-visual-editor th,
.email-template-visual-editor td { padding: 0.35rem; border: 1px solid var(--color-border); text-align: left; }
.email-template-variable-list { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; padding: 0.62rem 0.7rem; border: 1px solid var(--color-border); border-radius: 0.55rem; color: var(--color-muted); background: color-mix(in srgb, var(--color-panel) 82%, var(--color-primary) 18%); font-size: 0.74rem; }
.email-template-variable-list strong { margin-right: 0.15rem; color: var(--color-text); }
.email-template-variable-list code,
.email-admin-section .detail-note code { padding: 0.12rem 0.26rem; border: 1px solid var(--color-border); border-radius: 0.3rem; color: var(--color-text); background: var(--color-surface); font-size: 0.72rem; }
.email-template-variable-list code.is-required { border-color: color-mix(in srgb, var(--color-primary) 65%, var(--color-border)); color: var(--color-primary-strong); font-weight: 800; }
.email-template-preview { overflow: hidden; border: 1px solid var(--color-border); border-radius: 0.55rem; background: var(--color-panel); }
.email-template-preview > summary { display: flex; align-items: center; gap: 0.5rem; padding: 0.62rem 0.72rem; cursor: pointer; list-style: none; color: var(--color-text); font-size: 0.78rem; font-weight: 750; }
.email-template-preview > summary::after { margin-left: auto; }
.email-template-preview > div { min-height: 5rem; padding: 1rem; border-top: 1px solid var(--color-border); color: #17202f; background: #fff; line-height: 1.5; }
.email-template-preview > div p:first-child { margin-top: 0; }
.email-template-preview > div p:last-child { margin-bottom: 0; }
.email-template-preview > div table { width: 100%; border-collapse: collapse; }
.email-template-preview > div th,
.email-template-preview > div td { padding: 0.35rem; border: 1px solid #d9dee7; text-align: left; }

/* Gestão dos assuntos de notas. */
.note-subject-create { display: grid; grid-template-columns: minmax(14rem, 2fr) minmax(9rem, 1fr) minmax(5rem, .45fr) auto; align-items: end; gap: .75rem; margin: .25rem 0 1.1rem; }
.note-subject-create label { display: grid; gap: .32rem; color: var(--color-muted); font-size: .78rem; font-weight: 750; }
.note-subject-create input,
.note-subject-create select,
.note-subjects-table input:not([type="checkbox"]),
.note-subjects-table select { width: 100%; }
.note-subjects-table .is-archived { opacity: .66; }
.note-subject-actions { display: flex; flex-wrap: wrap; gap: .42rem; }
.note-subject-actions form { margin: 0; }
.checkbox-label { display: inline-flex; align-items: center; gap: .42rem; white-space: nowrap; }

@media (max-width: 760px) {
  .note-subject-create { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .note-subject-create .button { width: 100%; }
  .note-subjects-table td:nth-child(1)::before { content: 'Assunto'; }
  .note-subjects-table td:nth-child(2)::before { content: 'Pré-visualização'; }
  .note-subjects-table td:nth-child(3)::before { content: 'Cor'; }
  .note-subjects-table td:nth-child(4)::before { content: 'Ordem'; }
  .note-subjects-table td:nth-child(5)::before { content: 'Estado'; }
  .note-subjects-table td:nth-child(6)::before { content: 'Ações'; }
}

@media (max-width: 620px) {
  .email-workflow-template > summary { align-items: flex-start; }
  .email-template-visual-editor { min-height: 15rem; }
  .invoice-reminder-safety { display: grid; gap: 0.25rem; }
  .invoice-reminder-delays { grid-template-columns: 1fr; }
}

/* Arquivo Digital — prioriza os documentos e mantém os formulários extensos
   recolhidos até serem necessários. */
.archive-disclosure { overflow: hidden; padding: 0; }
.archive-disclosure-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; cursor: pointer; list-style: none; }
.archive-disclosure-summary::-webkit-details-marker { display: none; }
.archive-disclosure-summary > span:first-child { display: grid; gap: 0.18rem; min-width: 0; }
.archive-disclosure-summary strong { font-size: 1rem; }
.archive-disclosure-summary small { color: var(--color-muted); font-size: 0.78rem; line-height: 1.4; }
.archive-disclosure-action { flex: 0 0 auto; min-width: 4.65rem; padding: 0.28rem 0.48rem; border: 1px solid var(--color-border); border-radius: 999px; color: var(--color-primary-strong); font-size: 0.7rem; font-weight: 800; text-align: center; }
.archive-disclosure[open] > .archive-disclosure-summary { border-bottom: 1px solid var(--color-border); background: color-mix(in srgb, var(--color-primary) 7%, var(--color-surface)); }
.archive-disclosure[open] .archive-disclosure-action { color: var(--color-text); background: var(--color-surface-soft); }
.archive-disclosure[open] .archive-disclosure-action { font-size: 0; }
.archive-disclosure[open] .archive-disclosure-action::after { content: 'Fechar'; font-size: 0.7rem; }
.archive-disclosure-content { padding: 1rem 1.1rem 1.1rem; }
.archive-disclosure-content .archive-breadcrumbs { margin-top: 0; }
.archive-upload-panel .archive-disclosure-content { padding-top: 0.9rem; }
.archive-documents-panel { margin-top: 1rem; border-top: 3px solid var(--color-primary); }
.archive-documents-heading { align-items: center; }
.archive-record-count { display: inline-grid; min-width: 2.45rem; height: 2.45rem; place-items: center; border-radius: 50%; color: #6c3500; background: color-mix(in srgb, var(--color-primary) 23%, var(--color-surface)); font-size: 1rem; font-weight: 850; }

/* Administração do Arquivo: cada operação fica numa unidade curta e legível. */
.archive-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.archive-admin-grid > .archive-admin-folder-panel,
.archive-admin-grid > .archive-admin-recycle-panel { grid-column: 1 / -1; }
.archive-admin-folder-panel { gap: 1rem !important; }
.archive-admin-configuration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.archive-admin-action { display: grid; gap: 0.7rem; min-width: 0; padding: 0.8rem; border: 1px solid var(--color-border); border-radius: 0.6rem; background: color-mix(in srgb, var(--color-surface) 88%, var(--color-primary) 12%); }
.archive-admin-action > div { display: grid; gap: 0.16rem; }
.archive-admin-action strong,
.archive-admin-current > strong { font-size: 0.82rem; }
.archive-admin-action small,
.archive-admin-current > p { margin: 0; color: var(--color-muted); font-size: 0.72rem; line-height: 1.35; }
.archive-admin-danger { border-color: color-mix(in srgb, var(--color-danger) 45%, var(--color-border)); background: color-mix(in srgb, var(--color-danger) 7%, var(--color-surface)); }
.archive-admin-grid .archive-admin-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; margin: 0; padding: 0; border: 0; background: transparent; }
.archive-admin-grid .archive-admin-action .archive-admin-form { grid-template-columns: minmax(10rem, 1fr) minmax(11rem, 1fr) auto; }
.archive-admin-grid .archive-admin-action .archive-admin-form .checkbox-field { min-height: 2.5rem; margin: 0; padding: 0.45rem 0; }
.archive-admin-grid .archive-admin-action:nth-child(3) .archive-admin-form { grid-template-columns: minmax(0, 1fr) auto; }
.archive-admin-grid .archive-admin-action:nth-child(4) .archive-admin-form { grid-template-columns: minmax(0, 1fr) auto; }
.archive-permission-form { grid-template-columns: repeat(3, minmax(0, 1fr)) auto !important; }
.archive-watcher-form { grid-template-columns: minmax(12rem, 1fr) minmax(9rem, .65fr) auto !important; }
.archive-type-form { grid-template-columns: minmax(13rem, 1fr) auto !important; }
.archive-admin-current { display: grid; gap: 0.38rem; padding-top: 0.1rem; }
.archive-admin-current .archive-watcher-list { margin: 0; }
.archive-admin-table { border: 1px solid var(--color-border); border-radius: 0.55rem; }
.archive-admin-table table { margin: 0; }
.archive-recover-form { display: block !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; }

/* Escolha de utilizadores por equipa: linhas horizontais para seleção rápida. */
.user-planning-filter-form .user-planning-users-field { grid-column: 1 / -1; }
.user-planning-users-picker { display: grid; gap: 0.5rem; }
.user-planning-users-toolbar { display: flex; align-items: center; gap: 0.75rem; }
.user-planning-user-search { flex: 0 1 22rem; min-width: 12rem; }
.user-planning-user-search input { width: 100%; min-width: 0; }
.user-planning-users-toolbar strong { flex: 0 0 auto; color: var(--color-primary-strong); font-size: 0.72rem; white-space: nowrap; }
.user-planning-users-picker .user-planning-users-actions { display: flex; align-items: center; justify-content: flex-start; gap: 0.55rem 0.9rem; }
.user-planning-users-picker .user-planning-select-all { margin-top: 0; }
.user-planning-users-picker .user-planning-users-list { display: grid; max-height: none; padding: 0; overflow: visible; border: 1px solid var(--color-border); border-radius: 0.55rem; background: rgba(10, 20, 32, 0.26); }
.user-planning-users-picker .user-planning-users-list section { display: grid; grid-template-columns: minmax(15.5rem, 17rem) minmax(0, 1fr); gap: 0; min-height: 2.85rem; padding: 0; }
.user-planning-users-picker .user-planning-users-list section + section { margin-top: 0; border-top: 1px solid rgba(100, 122, 147, 0.3); }
.user-planning-users-list section > header { display: flex; align-items: center; justify-content: flex-start; gap: 0.6rem; padding: 0.45rem 0.8rem; border-right: 1px solid rgba(100, 122, 147, 0.3); background: rgba(83, 122, 155, 0.13); }
.user-planning-team-toggle { display: inline-flex !important; flex: 1 1 auto; min-width: 0; align-items: center; gap: 0.42rem; min-height: 1.3rem !important; padding: 0 !important; color: var(--color-text) !important; font-size: 0.68rem !important; font-weight: 850; letter-spacing: 0.04em; }
.user-planning-team-toggle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-planning-team-toggle:hover { background: transparent !important; }
.user-planning-team-toggle input { accent-color: var(--color-primary); }
.user-planning-users-list section > header small { flex: 0 0 auto; margin: 0; color: var(--color-muted); font-size: 0.64rem; white-space: nowrap; }
.user-planning-team-members { display: flex; flex-wrap: wrap; align-content: center; gap: 0.22rem 0.3rem; padding: 0.36rem 0.55rem; }
.user-planning-users-picker .user-planning-team-members label { display: inline-flex; width: auto; min-height: 1.9rem; padding: 0.18rem 0.55rem; border: 0; border-radius: 0.35rem; background: transparent; font-size: 0.74rem; white-space: nowrap; }
.user-planning-users-picker .user-planning-users-list input { box-sizing: border-box; width: 1rem; min-width: 1rem; height: 1rem; min-height: 1rem; margin: 0; padding: 0; }
.user-planning-users-picker .user-planning-users-list input:focus { outline-width: 2px; outline-offset: 1px; }
.user-planning-users-picker .user-planning-team-members label:hover { background: rgba(83, 122, 155, 0.16); }
.user-planning-users-picker .user-planning-team-members label:has(input:checked) { color: var(--color-primary-strong); background: var(--color-primary-soft); }

/* The header shortcuts share the same compact control; only the glyph differs. */
.header-notifications-symbol { font-size: 1rem; }

@media (max-width: 980px) {
  .archive-admin-configuration-grid { grid-template-columns: 1fr; }
  .archive-admin-grid .archive-admin-action .archive-admin-form,
  .archive-permission-form,
  .archive-watcher-form { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 760px) {
  .user-planning-users-picker .user-planning-users-list section { grid-template-columns: 1fr; }
  .user-planning-users-list section > header { border-right: 0; border-bottom: 1px solid rgba(100, 122, 147, 0.3); }
  .user-planning-team-members { padding: 0.45rem; }
}

@media (max-width: 620px) {
  .archive-disclosure-summary { align-items: flex-start; padding: 0.85rem; }
  .archive-disclosure-action { min-width: 3.8rem; }
  .archive-disclosure-content { padding: 0.85rem; }
  .archive-admin-grid { grid-template-columns: 1fr; }
  .archive-admin-grid > .archive-admin-folder-panel,
  .archive-admin-grid > .archive-admin-recycle-panel { grid-column: auto; }
  .archive-admin-grid .archive-admin-form,
  .archive-admin-grid .archive-admin-action .archive-admin-form,
  .archive-permission-form,
  .archive-watcher-form,
  .archive-type-form { grid-template-columns: 1fr !important; }
  .archive-admin-grid .archive-admin-form .button { width: 100%; }
  .user-planning-users-toolbar { display: grid; align-items: stretch; }
  .user-planning-users-toolbar strong { white-space: normal; }
  .user-planning-team-members { display: grid; grid-template-columns: 1fr; }
  .user-planning-users-picker .user-planning-team-members label { width: 100%; border-radius: 0.4rem; }
}

/* Preserve each project as a single visual card on mobile too. */
@media (max-width: 860px) {
  .data-table.project-data-table tr.project-actions-row {
    margin-bottom: 0;
    border-bottom: 0;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .data-table.project-data-table tr.project-content-row {
    margin-bottom: 0.75rem;
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
  }
}

/* Light theme accessibility corrections. Several long-lived modules used
   colours intended for the dark canvas directly; keep their semantics while
   giving text, alerts and secondary surfaces enough contrast on white. */
body.theme-light {
  --color-panel: #f7f9fc;
  --color-text-muted: #526579;
  --color-border-strong: #7f92a7;
  --color-success: #146c43;
  --color-warning: #7a5200;
  --color-danger: #a61b29;
  --light-info-text: #1e5f98;
  --light-success-text: #146c43;
  --light-success-bg: #edf9f1;
  --light-success-border: #8fcfac;
  --light-warning-text: #7a5200;
  --light-warning-bg: #fff6df;
  --light-warning-border: #dfbd6f;
  --light-danger-text: #a61b29;
  --light-danger-bg: #fff1f3;
  --light-danger-border: #dfa0a9;
  --light-info-bg: #edf6ff;
  --light-info-border: #91badf;
}

body.theme-light .topbar,
body.theme-light .legacy-topbar {
  background: rgba(255, 255, 255, 0.96);
}

/* Planning Geral used a dark translucent card surface in every theme. In the
   light theme that put dark project data over a dark overlay, which made the
   operational summary difficult to read. Keep the information groups distinct
   with pale surfaces and text colours that meet the light-theme contrast. */
body.theme-light .planning-project-overview > .planning-overview-field {
  color: #102a43;
  border-color: #9db2c5;
  background: #f4f8fb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body.theme-light .planning-project-overview > .planning-overview-field-project-type,
body.theme-light .planning-project-overview > .planning-overview-field-work-type {
  border-color: #91bdd9;
  background: #eaf4fb;
}

body.theme-light .planning-project-overview > .planning-overview-field-customer,
body.theme-light .planning-project-overview > .planning-overview-field-billing-customer {
  border-color: #bba8d1;
  background: #f5f0fa;
}

body.theme-light .planning-project-overview > .planning-overview-field-tasks,
body.theme-light .planning-project-overview > .planning-overview-field-teams {
  border-color: #8dbcae;
  background: #ecf8f4;
}

body.theme-light .planning-project-overview > .planning-overview-field-folder {
  border-color: #aab7c5;
  background: #f2f5f8;
}

body.theme-light .planning-project-overview > .planning-overview-field-margin {
  border-color: #a8be85;
  background: #f3f8ed;
}

body.theme-light .planning-project-overview > .planning-overview-field-time {
  border-color: #96b9d5;
  background: #edf5fb;
}

body.theme-light .planning-project-overview > .planning-overview-field-delivery {
  border-color: #d5b16d;
  background: #fff7e8;
}

body.theme-light .planning-project-overview span {
  color: #365a73;
}

body.theme-light .planning-project-overview strong {
  color: #102a43;
  font-weight: 800;
}

body.theme-light .planning-project-overview strong.planning-danger,
body.theme-light .planning-project-overview em.planning-danger {
  color: var(--light-danger-text);
}

body.theme-light .planning-project-overview strong.planning-warning {
  color: var(--light-warning-text);
}

body.theme-light .planning-project-overview strong.planning-success {
  color: var(--light-success-text);
}

body.theme-light input:focus,
body.theme-light select:focus,
body.theme-light textarea:focus,
body.theme-light button:focus-visible,
body.theme-light a:focus-visible {
  outline-color: rgba(158, 71, 5, 0.52);
}

body.theme-light .alert-error,
body.theme-light .task-workspace-status.task-workspace-status-error,
body.theme-light .user-planning-status.is-error {
  color: var(--light-danger-text);
  border-color: var(--light-danger-border);
  background: var(--light-danger-bg);
}

body.theme-light .alert-warning {
  color: var(--light-warning-text);
  border-color: var(--light-warning-border);
  background: var(--light-warning-bg);
}

body.theme-light .alert-success,
body.theme-light .task-workspace-status,
body.theme-light .user-planning-status {
  color: var(--light-success-text);
  border-color: var(--light-success-border);
  background: var(--light-success-bg);
}

body.theme-light .field-message,
body.theme-light .project-inline-status.project-inline-error,
body.theme-light .project-billing-customer-change-status.is-error,
body.theme-light .project-payment-condition-status.is-error,
body.theme-light .project-detail-category-status.is-error,
body.theme-light .average-cost-time-distribution-status.is-error,
body.theme-light .estimate-save-status.estimate-save-error,
body.theme-light .margin-danger,
body.theme-light .project-create-estimate-summary strong.margin-danger,
body.theme-light .planning-danger,
body.theme-light .monitoring-negative,
body.theme-light .efficiency-negative,
body.theme-light .task-registered-time.has-time,
body.theme-light .project-task-real.has-time,
body.theme-light .my-task-delivery.is-overdue,
body.theme-light .my-task-suspended {
  color: var(--light-danger-text);
}

body.theme-light .project-inline-status.project-inline-success,
body.theme-light .project-billing-customer-change-status.is-success,
body.theme-light .project-payment-condition-status.is-success,
body.theme-light .project-detail-category-status.is-success,
body.theme-light .average-cost-time-distribution-status.is-success,
body.theme-light .estimate-save-status.estimate-save-success,
body.theme-light .margin-healthy,
body.theme-light .project-create-estimate-summary strong.margin-healthy,
body.theme-light .project-creation-section.is-complete > summary small,
body.theme-light .project-required-field.is-complete .field-label::after,
body.theme-light .task-distribution-complete,
body.theme-light .validation-task-status-awaiting_validation,
body.theme-light .user-planning-legend .is-available,
body.theme-light .user-planning-lane > header small,
body.theme-light .user-planning-card em {
  color: var(--light-success-text);
}

body.theme-light .margin-warning,
body.theme-light .project-create-estimate-summary strong.margin-warning,
body.theme-light .planning-warning,
body.theme-light .intelligent-planning-warnings,
body.theme-light .efficiency-situation,
body.theme-light .user-task-competency-status.status-suspended {
  color: var(--light-warning-text);
}

body.theme-light .field-error input,
body.theme-light .field-error select,
body.theme-light .field-error textarea,
body.theme-light .project-required-field {
  border-color: var(--light-danger-border);
  background: #fff8f9;
}

body.theme-light .project-required-field.is-complete {
  border-color: var(--light-success-border);
  background: var(--light-success-bg);
}

body.theme-light .vacation-month,
body.theme-light .project-expanded-row > td,
body.theme-light .member-picker,
body.theme-light .workload-person-card,
body.theme-light .workload-project-team-card,
body.theme-light .workload-project-team-chart,
body.theme-light .future-workload-team-card,
body.theme-light .future-workload-person-card,
body.theme-light .intelligent-planning-metrics > div,
body.theme-light .intelligent-planning-tech-suggestion,
body.theme-light .task-dependency-list,
body.theme-light .user-planning-users-list,
body.theme-light .user-planning-users-picker .user-planning-users-list,
body.theme-light .user-planning-lane {
  background: var(--color-panel);
}

body.theme-light .user-planning-board-day-header {
  background: #eef3f8;
}

body.theme-light .quick-module:hover,
body.theme-light .module-card:hover,
body.theme-light .dashboard-message-link:hover {
  background: var(--color-surface-soft);
}

body.theme-light .vacation-day.is-weekend {
  color: #596d82;
  background: #edf1f5;
}

body.theme-light .vacation-day.is-holiday {
  color: var(--light-danger-text);
  background: #ffe7eb;
}

body.theme-light .vacation-day.is-rejected {
  color: #7f1e2b;
  background: #ffdce2;
}

body.theme-light .vacation-day.is-cancelled {
  color: #536577;
  background: #e6ebf1;
}

body.theme-light .vacation-legend-approved { color: var(--light-success-text) !important; }
body.theme-light .vacation-legend-pending { color: var(--light-warning-text) !important; }
body.theme-light .vacation-legend-rejected,
body.theme-light .vacation-legend-holiday { color: var(--light-danger-text) !important; }
body.theme-light .vacation-legend-cancelled { color: #536577 !important; }
body.theme-light .vacation-legend-bridge { color: #59428d !important; }
body.theme-light .vacation-legend-absence { color: var(--light-info-text) !important; }

body.theme-light .project-automatic-email-control > summary {
  color: var(--light-success-text);
  border-color: #79b693;
  background: var(--light-success-bg);
}

body.theme-light .project-automatic-email-control.is-paused > summary {
  color: var(--light-danger-text);
  border-color: var(--light-danger-border);
  background: var(--light-danger-bg);
}

body.theme-light .project-automatic-email-control.is-global-inactive > summary,
body.theme-light .project-automatic-email-control.is-ineligible > summary,
body.theme-light .project-automatic-email-control.is-unavailable > summary,
body.theme-light .project-automatic-email-control.is-completed > summary,
body.theme-light .project-automatic-email-control.is-attention > summary {
  border-color: #aab9ca;
  color: #526579;
  background: #f2f5f8;
}

body.theme-light .message-row.is-unread {
  border-left-color: #4c92c9;
  background: var(--light-info-bg);
}

body.theme-light .message-read-state {
  color: var(--light-info-text);
  border-color: var(--light-info-border);
}

body.theme-light .my-task-category,
body.theme-light .my-task-delivery,
body.theme-light .my-task-priority-label,
body.theme-light .my-task-suspended {
  background: #f4f7fa;
}

body.theme-light .validation-task-status-awaiting_validation {
  border-color: var(--light-success-border);
  background: var(--light-success-bg);
}

body.theme-light .validation-task-status-validated {
  color: var(--light-info-text);
  border-color: var(--light-info-border);
  background: var(--light-info-bg);
}

body.theme-light .validation-task-status-assigned {
  color: var(--light-warning-text);
  border-color: var(--light-warning-border);
  background: var(--light-warning-bg);
}

body.theme-light .validation-task-status-unassigned {
  color: var(--light-danger-text);
  border-color: var(--light-danger-border);
  background: var(--light-danger-bg);
}

body.theme-light .status-active {
  color: var(--light-info-text);
  background: var(--light-info-bg);
}

body.theme-light .status-delayed {
  color: var(--light-danger-text);
  background: var(--light-danger-bg);
}

body.theme-light .status-suspended {
  color: var(--light-warning-text);
  background: var(--light-warning-bg);
}

body.theme-light .status-finished {
  color: var(--light-success-text);
  background: var(--light-success-bg);
}

body.theme-light .efficiency-status-success,
body.theme-light .workload-load-ok,
body.theme-light .workload-load-available,
body.theme-light .monitoring-status {
  color: var(--light-success-text);
  border-color: var(--light-success-border);
  background: var(--light-success-bg);
}

body.theme-light .efficiency-status-warning,
body.theme-light .workload-load-attention,
body.theme-light .monitoring-status.is-attention {
  color: var(--light-warning-text);
  border-color: var(--light-warning-border);
  background: var(--light-warning-bg);
}

body.theme-light .efficiency-status-danger,
body.theme-light .workload-load-critical,
body.theme-light .workload-load-overloaded,
body.theme-light .monitoring-status.is-overloaded {
  color: var(--light-danger-text);
  border-color: var(--light-danger-border);
  background: var(--light-danger-bg);
}

/* 167# — Relatório Integrado */
.integrated-heading h1,
.integrated-heading p,
.integrated-section h3 {
  margin: 0;
}

.integrated-filter-panel > summary,
.integrated-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}

.integrated-filter-panel > summary::-webkit-details-marker,
.integrated-section > summary::-webkit-details-marker {
  display: none;
}

.integrated-filter-panel > summary::after,
.integrated-section > summary::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 1.5rem;
  line-height: 1;
}

.integrated-filter-panel[open] > summary::after,
.integrated-section[open] > summary::after {
  content: "−";
}

.integrated-filter-panel > summary span,
.integrated-section > summary span {
  margin-left: auto;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.integrated-filter-form,
.integrated-section > :not(summary) {
  margin-top: 1rem;
}

.integrated-filter-form {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

/* Indicadores do Relatório Integrado: a grelha e a anatomia do card são
   deliberadamente partilhadas por resumo, comparações e qualidade dos dados.
   Isso mantém cada conjunto compacto e alinhado, mesmo quando um valor ou
   descrição ocupa mais espaço. */
.integrated-card-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: minmax(11.5rem, auto);
  gap: .75rem;
  align-items: stretch;
}

.integrated-card-grid .metric-card {
  display: grid;
  grid-template-rows: minmax(2.3rem, auto) minmax(2.5rem, auto) minmax(2.8rem, 1fr);
  align-items: start;
  min-width: 0;
  min-height: 11.5rem;
  height: 100%;
  padding: .9rem;
}

.integrated-card-grid .metric-card > span {
  min-width: 0;
  min-height: 2.3rem;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.integrated-card-grid .metric-card > strong {
  align-self: center;
  min-width: 0;
  margin-top: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.35rem, 1.8vw, 2rem);
  line-height: 1.15;
}

.integrated-card-grid .metric-card > small {
  align-self: end;
  min-width: 0;
  min-height: 2.8rem;
  overflow-wrap: anywhere;
}

.integrated-metric-description {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--color-muted);
  font-size: .72rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.integrated-indexes,
.integrated-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.integrated-indexes span {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  color: var(--color-muted);
}

.integrated-indexes strong {
  color: var(--color-text);
}

/* 188# — Shared identity for every collapsed filter card. The icon is drawn
   with a mask so it follows the active theme colour without duplicating SVG
   markup in each view. */
.filter-card {
  border-color: color-mix(in srgb, var(--color-primary) 38%, var(--color-border));
  background: color-mix(in srgb, var(--color-primary) 4%, var(--color-surface));
}

.filter-card > summary {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-height: 3.25rem;
  padding: .82rem 1rem;
  cursor: pointer;
  list-style: none;
  background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface));
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--color-primary-strong) 82%, transparent);
}

.filter-card > summary::-webkit-details-marker { display: none; }

.filter-card > summary::before {
  content: '';
  display: block;
  align-self: center;
  flex: 0 0 .95rem;
  width: .95rem;
  height: .95rem;
  background: var(--color-primary-strong);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M1 2h14L9.5 8.15V14l-3-1.7V8.15L1 2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M1 2h14L9.5 8.15V14l-3-1.7V8.15L1 2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: none;
}

.filter-card:not([open]) > summary::before,
.filter-card[open] > summary::before { transform: none; }

.filter-card[open] > summary {
  border-bottom: 1px solid color-mix(in srgb, var(--color-primary) 32%, var(--color-border));
  background: color-mix(in srgb, var(--color-primary) 13%, var(--color-surface));
}

body.theme-contrast .filter-card {
  border-width: 2px;
  border-left-width: 5px;
  border-color: var(--color-text);
  background: var(--color-surface-elevated);
}

body.theme-contrast .filter-card > summary {
  background: var(--color-surface-soft);
  box-shadow: inset 4px 0 0 var(--color-accent);
}

@media (max-width: 720px) {
  .filter-card > summary { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--color-primary-strong) 82%, transparent); }
}

.integrated-alert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
}

.integrated-alert-grid .alert {
  display: grid;
  gap: 0.25rem;
  margin: 0;
}

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

.integrated-narrative {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding-left: 1.2rem;
}

.integrated-bar-chart {
  display: grid;
  gap: 0.75rem;
}

.integrated-bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(120px, 2fr) 42px;
  align-items: center;
  gap: 0.75rem;
}

.integrated-bar-row > div {
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-border) 65%, transparent);
}

.integrated-bar {
  display: block;
  min-width: 2px;
  height: 100%;
  border-radius: inherit;
  background: var(--color-primary);
  color: var(--color-primary);
}

.integrated-bar-within_plan { background: #2f9e68; color: #2f9e68; }
.integrated-bar-within_tolerance { background: #73b55b; color: #73b55b; }
.integrated-bar-attention { background: #e9a23b; color: #e9a23b; }
.integrated-bar-critical { background: #d94b55; color: #d94b55; }
.integrated-bar-no_prediction { background: #7b8794; color: #7b8794; }
.integrated-bar-project { background: var(--color-primary); color: var(--color-primary); }
.integrated-bar-administration { background: #74879a; color: #74879a; }
.integrated-bar-training { background: #8b6fc0; color: #8b6fc0; }
.integrated-bar-unregistered { background: #e9a23b; color: #e9a23b; }
.integrated-bar-over_capacity,
.integrated-bar-margin-negative { background: #d94b55; color: #d94b55; }
.integrated-bar-margin-zero_five,
.integrated-bar-margin-five_ten { background: #e9a23b; color: #e9a23b; }
.integrated-bar-margin-ten_fifteen,
.integrated-bar-margin-fifteen_twenty { background: #83a84d; color: #83a84d; }
.integrated-bar-margin-twenty_twenty_five,
.integrated-bar-margin-twenty_five_thirty,
.integrated-bar-margin-above_thirty { background: #2f9e68; color: #2f9e68; }
.integrated-bar-margin-unavailable { background: #7b8794; color: #7b8794; }

.integrated-horizontal-bar {
  display: block;
  width: 100%;
  height: 100%;
}

.integrated-horizontal-bar rect,
.integrated-trend-bar rect {
  fill: currentColor;
}

.integrated-trend {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(72px, 1fr);
  min-height: 230px;
  overflow-x: auto;
  gap: 0.7rem;
}

.integrated-trend article {
  display: grid;
  grid-template-rows: auto 170px auto;
  gap: 0.4rem;
  min-width: 72px;
  text-align: center;
}

.integrated-trend h3,
.integrated-trend small {
  font-size: 0.78rem;
}

.integrated-trend-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
}

.integrated-trend-bar {
  display: block;
  width: 24%;
  height: 100%;
  min-height: 2px;
}

.integrated-trend-bar svg {
  display: block;
  width: 100%;
  height: 100%;
}

.integrated-trend-bar-available { color: #74879a; }
.integrated-trend-bar-planned { color: #e9a23b; }
.integrated-trend-bar-actual { color: var(--color-primary); }

.integrated-trend-scale-note {
  margin: 0.7rem 0 0;
  color: var(--color-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.integrated-chart-legend span::before,
.integrated-chart-legend i::before,
.integrated-chart-legend b::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 0.3rem;
  border-radius: 2px;
  background: #74879a;
}
.integrated-chart-legend i::before { background: #e9a23b; }
.integrated-chart-legend b::before { background: var(--color-primary); }

.integrated-table th,
.integrated-table td {
  white-space: nowrap;
}

.integrated-table td:first-child,
.integrated-table td:last-child {
  white-space: normal;
}

.integrated-table small {
  display: block;
  margin-top: 0.2rem;
  color: var(--color-muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.integrated-section .table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.integrated-table-group,
.integrated-table-tasks {
  table-layout: auto;
}

.integrated-table-group {
  min-width: 1120px;
}

.integrated-table-group-financial {
  min-width: 1360px;
}

.integrated-table-group th,
.integrated-table-group td,
.integrated-table-tasks th,
.integrated-table-tasks td {
  padding: 0.62rem 0.58rem;
  line-height: 1.35;
}

.integrated-table-group th,
.integrated-table-tasks th {
  white-space: normal;
}

.integrated-table-group th:first-child,
.integrated-table-group td:first-child {
  width: clamp(13rem, 21vw, 23rem);
  min-width: 13rem;
  white-space: normal;
}

.integrated-table-group td:first-child a,
.integrated-table-tasks td:nth-child(2) {
  overflow-wrap: anywhere;
}

.integrated-table-group td:nth-child(7) {
  white-space: normal;
}

.integrated-table-group td:last-child {
  white-space: nowrap;
}

.integrated-table-group td:last-child small {
  white-space: normal;
}

.integrated-table-group .integrated-status {
  max-width: 10rem;
  white-space: normal;
  line-height: 1.2;
  text-align: center;
}

.integrated-table-tasks {
  min-width: 820px;
}

.integrated-table-tasks th:first-child,
.integrated-table-tasks td:first-child {
  width: 7.5rem;
  min-width: 7.5rem;
  white-space: normal;
}

.integrated-table-tasks th:nth-child(2),
.integrated-table-tasks td:nth-child(2) {
  width: clamp(15rem, 35vw, 34rem);
  min-width: 15rem;
  white-space: normal;
}

.integrated-table-tasks th:nth-child(3),
.integrated-table-tasks td:nth-child(3) {
  width: clamp(10rem, 16vw, 16rem);
  min-width: 10rem;
  white-space: normal;
}

.integrated-status {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  color: #fff;
  background: #7b8794;
  font-size: 0.75rem;
  font-weight: 700;
}

.integrated-status-within_plan { background: #2f9e68; }
.integrated-status-within_tolerance { background: #73a93d; }
.integrated-status-attention { background: #b97810; }
.integrated-status-critical { background: #c43642; }
.integrated-quality-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }

body.theme-contrast .integrated-card-grid .metric-card { border-width: 2px; }

@media (max-width: 1360px) {
  .integrated-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .integrated-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .integrated-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .integrated-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .integrated-filter-form,
  .integrated-overview-grid { grid-template-columns: 1fr; }
  .integrated-filter-panel > summary span,
  .integrated-section > summary span { display: none; }
  .integrated-bar-row { grid-template-columns: 110px minmax(90px, 1fr) 34px; }
  .integrated-table-group,
  .integrated-table-group-financial { min-width: 1020px; }
  .integrated-table-tasks { min-width: 690px; }
  .integrated-table-group th,
  .integrated-table-group td,
  .integrated-table-tasks th,
  .integrated-table-tasks td { padding: 0.5rem 0.45rem; }
}

@media (max-width: 560px) {
  .integrated-card-grid { grid-template-columns: 1fr; }
}

/* Dashboard da Administração / Gerência: hierarquia por grupos funcionais. */
.dashboard-functional-group {
  --dashboard-group-accent: #8b98a8;
  --dashboard-group-tint: rgba(139, 152, 168, 0.08);
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  margin-top: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--dashboard-group-accent);
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(135deg, var(--dashboard-group-tint), transparent 16rem);
}

.dashboard-functional-group-access {
  --dashboard-group-accent: #93a0af;
  --dashboard-group-tint: rgba(147, 160, 175, 0.08);
}

.dashboard-functional-group-communication {
  --dashboard-group-accent: #4f9ad6;
  --dashboard-group-tint: rgba(79, 154, 214, 0.09);
}

.dashboard-functional-group-administration {
  --dashboard-group-accent: #8e76d4;
  --dashboard-group-tint: rgba(142, 118, 212, 0.09);
}

.dashboard-functional-group-individual {
  --dashboard-group-accent: #45ad97;
  --dashboard-group-tint: rgba(69, 173, 151, 0.09);
}

.dashboard-functional-group-control {
  --dashboard-group-accent: #6285a4;
  --dashboard-group-tint: rgba(98, 133, 164, 0.08);
}

.dashboard-functional-group-heading {
  display: grid;
  gap: 0.08rem;
  padding: 0 0.15rem 0.1rem;
}

.dashboard-functional-group-heading p,
.dashboard-functional-group-heading h2 {
  margin: 0;
}

.dashboard-functional-group-heading p {
  color: var(--dashboard-group-accent);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.dashboard-functional-group-heading h2 {
  font-size: clamp(0.94rem, 1.5vw, 1.08rem);
}

.dashboard-functional-group > .panel,
.dashboard-functional-group > .dashboard-work-grid,
.dashboard-functional-group > .administration-control-center {
  margin-top: 0;
}

.dashboard-functional-overview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  min-height: 4.3rem;
  margin: 0;
  padding: 0.85rem 0.95rem;
  border-left: 4px solid var(--dashboard-group-accent);
  background: var(--color-surface-elevated);
}

.dashboard-functional-overview .dashboard-summary-icon {
  color: var(--dashboard-group-accent);
  border-color: var(--dashboard-group-accent);
  background: transparent;
}

.dashboard-functional-overview > div {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.dashboard-functional-overview strong,
.dashboard-functional-overview span {
  overflow-wrap: anywhere;
}

.dashboard-functional-overview strong { font-size: 0.96rem; }
.dashboard-functional-overview span { color: var(--color-muted); font-size: 0.78rem; }

.dashboard-functional-quick-actions {
  margin: 0;
  padding: 0.1rem;
}

.dashboard-functional-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.75rem;
  min-width: 0;
}

.dashboard-functional-metric-card {
  --dashboard-metric-accent: var(--dashboard-group-accent);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  min-height: 4.3rem;
  padding: 0.78rem 0.85rem;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--dashboard-metric-accent);
  border-radius: var(--radius);
  color: var(--color-text);
  background: var(--color-surface-elevated);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.dashboard-functional-metric-card:hover,
.dashboard-functional-metric-card:focus-visible {
  color: var(--color-text);
  border-color: var(--dashboard-metric-accent);
  transform: translateY(-2px);
}

.dashboard-functional-metric-card.is-danger { --dashboard-metric-accent: var(--color-danger); }
.dashboard-functional-metric-card.is-warning { --dashboard-metric-accent: var(--color-warning); }
.dashboard-functional-metric-card.is-accent { --dashboard-metric-accent: var(--color-primary); }

.dashboard-functional-metric-card .dashboard-summary-icon {
  width: 2rem;
  height: 2rem;
  padding: 0.38rem;
  color: var(--dashboard-metric-accent);
  border-color: var(--dashboard-metric-accent);
  background: transparent;
}

.dashboard-functional-metric-card > span {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.dashboard-functional-metric-card strong,
.dashboard-functional-metric-card small { overflow-wrap: anywhere; }
.dashboard-functional-metric-card strong { font-size: 0.87rem; }
.dashboard-functional-metric-card small { color: var(--color-muted); font-size: 0.72rem; }

.dashboard-functional-metric-card > b {
  min-width: 2.15rem;
  color: var(--dashboard-metric-accent);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.dashboard-functional-card {
  --dashboard-card-accent: var(--color-primary);
  padding: 0;
  overflow: hidden;
}

.dashboard-functional-group .dashboard-functional-card {
  --dashboard-card-accent: var(--dashboard-group-accent);
  border-top: 1px solid var(--color-border);
  border-left: 4px solid var(--dashboard-card-accent);
}

.dashboard-functional-card > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.7rem;
  min-height: 4.3rem;
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  list-style: none;
}

.dashboard-functional-card > summary::-webkit-details-marker {
  display: none;
}

.dashboard-functional-card > summary::after {
  grid-column: 4;
  content: '+';
  color: var(--dashboard-card-accent);
  font-size: 1.15rem;
  font-weight: 900;
}

.dashboard-functional-card[open] > summary {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
}

.dashboard-functional-card[open] > summary::after {
  content: '−';
}

.dashboard-functional-card > summary > span:not(.dashboard-summary-badge) {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.dashboard-functional-card > summary strong,
.dashboard-functional-card > summary small {
  display: block;
  overflow-wrap: anywhere;
}

.dashboard-functional-card > summary strong {
  font-size: 0.96rem;
}

.dashboard-functional-card > summary small {
  color: var(--color-muted);
  font-size: 0.76rem;
  font-weight: 400;
}

.dashboard-functional-card .dashboard-summary-icon {
  color: var(--dashboard-card-accent);
  border-color: var(--dashboard-card-accent);
  background: transparent;
}

.dashboard-summary-badge,
.dashboard-functional-card > summary > b {
  display: inline-grid;
  min-width: 2rem;
  min-height: 2rem;
  place-items: center;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--dashboard-card-accent);
  border-radius: 999px;
  color: var(--color-text);
  background: var(--color-surface-soft);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.dashboard-functional-card-body {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem;
}

.dashboard-functional-card-body > .alert,
.dashboard-functional-card-body > .empty-state {
  margin: 0;
}

.dashboard-functional-card-link {
  width: fit-content;
  justify-self: end;
  font-size: 0.8rem;
  font-weight: 750;
}

.dashboard-personal-learning-period-compact {
  display: grid;
  gap: 0.12rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-warning);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}

.dashboard-personal-learning-period-compact span {
  color: var(--color-muted);
  font-size: 0.78rem;
}

.dashboard-functional-group-individual .dashboard-work-grid {
  gap: 0.75rem;
}

.dashboard-functional-group-individual .dashboard-functional-card {
  min-width: 0;
}

/* 203# — Two-week operational availability. The card inherits the dashboard
   component; these rules only arrange its week summaries without tables or
   horizontal scrolling. */
.dashboard-team-availability-card .dashboard-functional-card-body {
  gap: .9rem;
}

.dashboard-availability-week-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  min-width: 0;
}

.dashboard-availability-week {
  display: grid;
  align-content: start;
  gap: .7rem;
  min-width: 0;
  padding: .8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
}

.dashboard-availability-week-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: .65rem;
}

.dashboard-availability-week-heading h3,
.dashboard-availability-week-heading p,
.dashboard-availability-summary,
.dashboard-availability-events h4 {
  margin: 0;
}

.dashboard-availability-week-heading h3 { font-size: .9rem; }
.dashboard-availability-week-heading p,
.dashboard-availability-summary { color: var(--color-muted); font-size: .74rem; line-height: 1.35; }
.dashboard-availability-week-heading > strong { flex: 0 0 auto; color: var(--dashboard-card-accent); font-variant-numeric: tabular-nums; }

.dashboard-availability-events {
  display: grid;
  gap: .45rem;
  min-width: 0;
}

.dashboard-availability-events h4 {
  color: var(--dashboard-card-accent);
  font-size: .74rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.dashboard-availability-event {
  display: grid;
  gap: .12rem;
  min-width: 0;
  padding: .55rem .6rem;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--dashboard-card-accent);
  border-radius: calc(var(--radius) - 2px);
  background: var(--color-surface-soft);
}

.dashboard-availability-event strong,
.dashboard-availability-event span,
.dashboard-availability-event small {
  overflow-wrap: anywhere;
}

.dashboard-availability-event strong { font-size: .78rem; }
.dashboard-availability-event span,
.dashboard-availability-event small { color: var(--color-muted); font-size: .73rem; line-height: 1.35; }
.dashboard-availability-birthdays .dashboard-availability-event { border-left-color: var(--color-warning); }

body.theme-contrast .dashboard-availability-week,
body.theme-contrast .dashboard-availability-event { border-width: 2px; }

.dashboard-functional-group-control .administration-control-center {
  gap: 0.75rem;
}

.administration-dashboard-section {
  --dashboard-area-accent: #6b8dad;
  border-left: 4px solid var(--dashboard-area-accent);
}

.administration-dashboard-section#management-summary { --dashboard-area-accent: #4f9ad6; }
.administration-dashboard-section#management-alerts { --dashboard-area-accent: #ef7a4d; }
.administration-dashboard-section#management-week-activity { --dashboard-area-accent: #d5a72e; }
.administration-dashboard-section#management-teams { --dashboard-area-accent: #49a86f; }
.administration-dashboard-section#management-financial { --dashboard-area-accent: #8e76d4; }
.administration-dashboard-section#management-system { --dashboard-area-accent: #718ba3; }

.administration-dashboard-section > summary::after,
.administration-dashboard-section > summary .dashboard-summary-icon {
  color: var(--dashboard-area-accent);
}

.administration-dashboard-section > summary .dashboard-summary-icon {
  border-color: var(--dashboard-area-accent);
  background: transparent;
}

body.theme-light .dashboard-functional-group {
  --dashboard-group-tint: rgba(83, 111, 139, 0.055);
}

body.theme-light .dashboard-functional-group-communication { --dashboard-group-tint: rgba(43, 125, 188, 0.07); }
body.theme-light .dashboard-functional-group-administration { --dashboard-group-tint: rgba(112, 84, 185, 0.07); }
body.theme-light .dashboard-functional-group-individual { --dashboard-group-tint: rgba(34, 139, 116, 0.07); }

body.theme-contrast .dashboard-functional-group {
  --dashboard-group-accent: #ffffff;
  --dashboard-group-tint: transparent;
  border-width: 2px 2px 2px 5px;
}

body.theme-contrast .dashboard-functional-group-communication { --dashboard-group-accent: #63d8ff; }
body.theme-contrast .dashboard-functional-group-administration { --dashboard-group-accent: #e4a8ff; }
body.theme-contrast .dashboard-functional-group-individual { --dashboard-group-accent: #7fffbd; }
body.theme-contrast .dashboard-functional-group-control { --dashboard-group-accent: #b8dcff; }
body.theme-contrast .administration-dashboard-section#management-summary { --dashboard-area-accent: #63d8ff; }
body.theme-contrast .administration-dashboard-section#management-alerts { --dashboard-area-accent: #ff9d6e; }
body.theme-contrast .administration-dashboard-section#management-week-activity { --dashboard-area-accent: #ffe066; }
body.theme-contrast .administration-dashboard-section#management-teams { --dashboard-area-accent: #7fff86; }
body.theme-contrast .administration-dashboard-section#management-financial { --dashboard-area-accent: #e4a8ff; }
body.theme-contrast .administration-dashboard-section#management-system { --dashboard-area-accent: #b8dcff; }

body.theme-contrast .dashboard-functional-card,
body.theme-contrast .administration-dashboard-section,
body.theme-contrast .dashboard-functional-overview,
body.theme-contrast .dashboard-functional-metric-card {
  border-width: 2px 2px 2px 5px;
}

@media (max-width: 680px) {
  .dashboard-functional-group {
    padding: 0.65rem;
  }

  .dashboard-functional-card > summary {
    gap: 0.55rem;
    padding: 0.75rem;
  }

  .dashboard-functional-card > summary small {
    font-size: 0.7rem;
  }

  .dashboard-functional-card .dashboard-summary-icon {
    width: 1.95rem;
    height: 1.95rem;
  }

  .dashboard-functional-metric-grid { grid-template-columns: 1fr; }
  .dashboard-availability-week-grid { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .dashboard-functional-card > summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .dashboard-functional-card > summary::after {
    grid-column: 3;
  }

  .dashboard-functional-card > summary > b,
  .dashboard-functional-card > summary > .dashboard-summary-badge {
    display: none;
  }

  .dashboard-functional-overview,
  .dashboard-functional-metric-card {
    gap: 0.55rem;
    padding: 0.75rem;
  }
}
/* JAS CableCalc: isolated electrical-calculation workspace. */
.electrical-page { max-width: 1800px; }
.electrical-hero { align-items: center; gap: 24px; }
.electrical-hero .eyebrow { margin: 0 0 6px; color: var(--accent, #f36b22); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.electrical-hero .eyebrow a { color: inherit; }
.electrical-hero-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.electrical-dataset-badge { padding: 8px 12px; border: 1px solid #d69a27; border-radius: 999px; color: #8b5b00; background: #fff7df; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.electrical-block { margin-bottom: 18px; overflow: visible; }
.electrical-warning, .electrical-normative-warning { border: 1px solid #d69a27; background: #fff8e6; color: #634500; }
.electrical-normative-warning { margin: 0 0 16px; padding: 13px 16px; border-radius: 10px; line-height: 1.5; }
.electrical-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.electrical-section-heading h2 { margin: 0 0 4px; }
.electrical-section-heading p { margin: 0; color: var(--text-muted, #667085); }
.electrical-project-table small, .electrical-circuit-table small { display: block; margin-top: 3px; color: var(--text-muted, #667085); white-space: nowrap; }
.electrical-status { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap; background: #eef1f5; color: #46505f; }
.electrical-status.is-compliant { background: #dff5e8; color: #12663a; }
.electrical-status.is-not_compliant { background: #fde3e3; color: #9c2424; }
.electrical-status.is-provisional { background: #fff0c9; color: #815300; }
.electrical-status.is-requires_validation { background: #fff0c9; color: #815300; }
.electrical-status.is-incomplete { background: #fff4d7; color: #77551a; }
.electrical-status.is-draft, .electrical-status.is-not_calculated { background: #e8edf4; color: #46505f; }
.electrical-anchor-nav { position: sticky; top: 6px; z-index: 8; display: flex; gap: 4px; padding: 6px; margin: 0 0 18px; overflow-x: auto; border: 1px solid var(--border, #dde2e9); border-radius: 10px; background: color-mix(in srgb, var(--surface, #fff) 95%, transparent); backdrop-filter: blur(8px); }
.electrical-anchor-nav a { padding: 7px 10px; border-radius: 7px; color: inherit; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.electrical-anchor-nav a:hover { background: var(--surface-soft, #eef2f6); }
.electrical-block > details > summary, .electrical-result > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; }
.electrical-block > details > summary::-webkit-details-marker, .electrical-result > summary::-webkit-details-marker { display: none; }
.electrical-block > details > summary span:first-child, .electrical-result > summary span:first-child { display: flex; flex-direction: column; gap: 3px; }
.electrical-block > details > summary small, .electrical-result > summary small { color: var(--text-muted, #667085); font-weight: 500; }
.electrical-block > details[open] > summary { margin-bottom: 18px; }
.electrical-form fieldset { min-width: 0; margin: 0 0 18px; padding: 16px; border: 1px solid var(--border, #dde2e9); border-radius: 10px; }
.electrical-form legend { padding: 0 8px; font-weight: 800; }
.electrical-form label { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: .76rem; font-weight: 700; }
.electrical-form input, .electrical-form select, .electrical-form textarea { width: 100%; min-width: 0; }
.electrical-form .electrical-checkbox { flex-direction: row; align-items: center; align-self: end; min-height: 42px; }
.electrical-form .electrical-checkbox input { width: auto; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.form-grid-6 { display: grid; grid-template-columns: repeat(6, minmax(135px, 1fr)); gap: 10px; }
.form-span-3 { grid-column: span 3; }
.field-help { margin: -5px 0 12px; color: var(--text-muted, #667085); font-size: .8rem; }
.electrical-segment { margin: 0 0 12px; padding: 13px; border: 1px solid var(--border, #dde2e9); border-left: 3px solid var(--accent, #f36b22); border-radius: 8px; background: var(--surface-soft, #f8fafc); }
.electrical-segment-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.electrical-subdetails { margin-top: 10px; }
.electrical-calculation-trace { max-width: 100%; max-height: 28rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .78rem; padding: 12px; border: 1px solid var(--border-color, #cbd5e1); border-radius: 8px; }
.electrical-conditional-options [hidden], .electrical-page label[hidden] { display: none !important; }
.electrical-page .electrical-field-missing { outline: 2px solid var(--accent, #d45415); outline-offset: 3px; }
.electrical-subdetails > summary, .electrical-advanced > summary { cursor: pointer; color: var(--accent, #d45415); font-weight: 800; }
.electrical-subdetails[open] > summary, .electrical-advanced[open] > summary { margin-bottom: 12px; }
.electrical-advanced { margin: 0 0 18px; padding: 14px; border: 1px dashed var(--border-strong, #bac2cd); border-radius: 10px; }
.electrical-circuit-scroll { max-height: 65vh; }
.electrical-circuit-table { min-width: 1780px; font-size: .75rem; }
.electrical-circuit-table thead { position: sticky; top: 0; z-index: 2; }
.electrical-circuit-table td { white-space: nowrap; }
.electrical-results-grid { display: grid; gap: 10px; }
.electrical-result { padding: 13px 15px; border: 1px solid var(--border, #dde2e9); border-radius: 9px; }
.electrical-result[open] > summary { margin-bottom: 14px; }
.electrical-criteria { display: grid; gap: 8px; }
.electrical-criterion { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 10px 12px; border-left: 3px solid #c49126; border-radius: 6px; background: var(--surface-soft, #f8fafc); }
.electrical-criterion.is-compliant { border-left-color: #23935a; }
.electrical-criterion.is-not_compliant { border-left-color: #c73535; }
.electrical-criterion.is-requires_validation { border-left-color: #c49126; }
.electrical-criterion > span { font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.electrical-criterion strong, .electrical-criterion p, .electrical-criterion small { display: block; margin: 0 0 3px; }
.electrical-criterion p, .electrical-criterion small { color: var(--text-muted, #667085); }
.electrical-checksum { display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
@media (max-width: 1250px) {
    .form-grid-4, .form-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid-6 { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}
@media (max-width: 760px) {
    .electrical-hero, .electrical-section-heading { align-items: flex-start; flex-direction: column; }
    .form-grid-3, .form-grid-4, .form-grid-5, .form-grid-6 { grid-template-columns: minmax(0, 1fr); }
    .form-span-2, .form-span-3 { grid-column: auto; }
    .electrical-criterion { grid-template-columns: 1fr; }
    .electrical-anchor-nav { position: static; }
}

/* Progressive live workspace shared by the definitive editor and BT V2. */
.electrical-step-nav { display: flex; gap: .4rem; margin: 0 0 1rem; overflow-x: auto; padding: .35rem; border: 1px solid var(--border, #dde2e9); border-radius: .65rem; background: color-mix(in srgb, var(--surface, #fff) 94%, transparent); }
.electrical-step-nav > a, .electrical-step-nav button { flex: 0 0 auto; min-height: 2rem; padding: .38rem .65rem; border: 1px solid transparent; border-radius: .4rem; background: transparent; color: var(--text-muted, #667085); font: inherit; font-size: .75rem; font-weight: 800; cursor: pointer; text-decoration: none; }
.electrical-step-nav > a:hover, .electrical-step-nav > a:focus-visible, .electrical-step-nav button:hover, .electrical-step-nav button:focus-visible, .electrical-step-nav button.is-active { border-color: var(--accent, #f36b22); background: color-mix(in srgb, var(--accent, #f36b22) 10%, var(--surface, #fff)); color: var(--text, #1d2939); outline: none; }
.electrical-step-nav button:disabled { cursor: not-allowed; opacity: .5; }
.electrical-step-nav-controls { display: flex; flex: 0 0 auto; gap: .25rem; margin-left: auto; padding-left: .35rem; border-left: 1px solid var(--border, #dde2e9); }
.electrical-progress-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(19rem, 28rem); align-items: start; gap: 1rem; }
.electrical-live-preview-panel { position: sticky; top: .75rem; min-width: 0; max-height: calc(100vh - 1.5rem); overflow: auto; padding: 1rem; border: 1px solid var(--border, #dde2e9); border-top: 3px solid var(--accent, #f36b22); border-radius: .7rem; background: var(--surface, #fff); box-shadow: 0 .5rem 1.5rem color-mix(in srgb, #111827 9%, transparent); transition: opacity .15s ease; }
.electrical-live-preview-panel.is-updating { opacity: .64; }
.electrical-live-preview-empty, .electrical-live-preview-error { padding: .5rem; }
.electrical-live-preview-error { border-left: 4px solid var(--color-warning, #c49126); background: color-mix(in srgb, var(--color-warning, #c49126) 12%, var(--surface, #fff)); }
.electrical-live-preview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.electrical-live-preview-heading h2 { margin: 0; font-size: 1.05rem; }
.electrical-live-preview-heading .eyebrow, .electrical-live-preview-empty .eyebrow { margin: 0 0 .2rem; color: var(--accent, #f36b22); font-size: .66rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.electrical-live-preview-notice { margin: .45rem 0 .8rem; color: var(--text-muted, #667085); font-size: .73rem; line-height: 1.4; }
.electrical-live-change { margin: -.3rem 0 .8rem; padding: .45rem .55rem; border-left: 3px solid var(--accent, #f36b22); border-radius: .35rem; background: color-mix(in srgb, var(--accent, #f36b22) 8%, var(--surface, #fff)); color: var(--text-muted, #667085); font-size: .7rem; line-height: 1.4; }
.electrical-live-sequence { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; padding: 0; margin: 0 0 .8rem; list-style: none; }
.electrical-live-sequence li { display: grid; gap: .12rem; min-width: 0; padding: .45rem; border: 1px solid var(--border, #dde2e9); border-radius: .4rem; background: var(--surface-soft, #f8fafc); }
.electrical-live-sequence span { color: var(--text-muted, #667085); font-size: .63rem; font-weight: 800; text-transform: uppercase; }
.electrical-live-sequence strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.electrical-live-sequence .is-compliant { border-color: #23935a; }.electrical-live-sequence .is-not_compliant { border-color: #c73535; }.electrical-live-sequence .is-incomplete, .electrical-live-sequence .is-requires_validation { border-color: #c49126; }
.electrical-live-kpis { display: grid; gap: .45rem; }
.electrical-live-kpis article { display: grid; gap: .15rem; padding: .55rem .65rem; border: 1px solid var(--border, #dde2e9); border-radius: .45rem; background: var(--surface-elevated, var(--surface-soft, #f8fafc)); transition: background-color .3s ease, box-shadow .3s ease; }
.electrical-live-kpis article > span { color: var(--text-muted, #667085); font-size: .66rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }.electrical-live-kpis strong { font-size: 1rem; }.electrical-live-kpis small { color: var(--text-muted, #667085); font-size: .69rem; line-height: 1.35; }
.electrical-live-kpis article.is-changed { box-shadow: inset 0 0 0 2px var(--accent, #f36b22); background: color-mix(in srgb, var(--accent, #f36b22) 11%, var(--surface, #fff)); }
.electrical-live-trace { margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--border, #dde2e9); }.electrical-live-trace summary { color: var(--accent, #f36b22); font-size: .78rem; font-weight: 800; cursor: pointer; }.electrical-live-trace dl { display: grid; gap: .45rem; margin: .65rem 0 0; }.electrical-live-trace dl > div { display: grid; gap: .15rem; padding-bottom: .4rem; border-bottom: 1px dashed var(--border, #dde2e9); }.electrical-live-trace dt { color: var(--text-muted, #667085); font-size: .68rem; }.electrical-live-trace dd { margin: 0; overflow-wrap: anywhere; font-size: .72rem; }
.electrical-live-criteria { display: grid; gap: .45rem; margin-top: .8rem; }.electrical-live-criteria h3 { margin: 0; font-size: .86rem; }.electrical-live-criteria .electrical-criterion { grid-template-columns: 5.75rem minmax(0, 1fr); gap: .55rem; padding: .55rem; }.electrical-live-criteria .electrical-criterion p, .electrical-live-criteria .electrical-criterion small { font-size: .68rem; }
.electrical-draft-review { display: grid; gap: .25rem; margin: 0 0 1rem; padding: .75rem; border-left: 3px solid var(--accent, #f36b22); border-radius: .45rem; background: color-mix(in srgb, var(--accent, #f36b22) 8%, var(--surface, #fff)); }.electrical-draft-review span { color: var(--text-muted, #667085); font-size: .76rem; }
body.theme-contrast .electrical-live-preview-panel, body.theme-contrast .electrical-live-kpis article, body.theme-contrast .electrical-step-nav { border-width: 2px; }
@media (prefers-reduced-motion: reduce) { .electrical-live-preview-panel, .electrical-live-kpis article { transition: none; } }
@media (max-width: 1180px) { .electrical-progress-layout { grid-template-columns: minmax(0, 1fr); }.electrical-live-preview-panel { position: static; max-height: none; } }
@media (max-width: 560px) { .electrical-live-sequence { grid-template-columns: repeat(2, minmax(0, 1fr)); }.electrical-live-criteria .electrical-criterion { grid-template-columns: 1fr; } }

/* Administração: áreas funcionais com o mesmo traço de ícones do Dashboard. */
.administration-hub { display: grid; gap: 1rem; margin-top: 1rem; min-width: 0; }
.administration-hub-hero { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.administration-hub-hero h1, .administration-hub-hero p { margin: 0; }
.administration-hub-hero h1 { margin: .08rem 0 .35rem; font-size: clamp(1.35rem, 2.5vw, 1.8rem); }
.administration-hub-hero > div > p:not(.eyebrow), .administration-hub-hero-note { max-width: 56rem; color: var(--color-muted); }
.administration-hub-hero .eyebrow, .administration-hub-group-heading > div > p { color: var(--administration-group-accent, var(--color-primary)); font-size: .7rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.administration-hub-hero-note { flex: 0 1 20rem; padding: .55rem .7rem; border-left: 3px solid var(--color-primary); border-radius: .35rem; background: var(--color-surface-soft); font-size: .78rem; }

.administration-hub-group {
  --administration-group-accent: #718ba3;
  --administration-group-tint: rgba(113, 139, 163, .09);
  display: grid;
  gap: .8rem;
  min-width: 0;
  padding: .9rem;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--administration-group-accent);
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(135deg, var(--administration-group-tint), transparent 18rem);
}

.administration-hub-group-people { --administration-group-accent: #4f9ad6; --administration-group-tint: rgba(79, 154, 214, .10); }
.administration-hub-group-operation { --administration-group-accent: #49a86f; --administration-group-tint: rgba(73, 168, 111, .10); }
.administration-hub-group-financial { --administration-group-accent: #8e76d4; --administration-group-tint: rgba(142, 118, 212, .10); }
.administration-hub-group-configuration { --administration-group-accent: #718ba3; --administration-group-tint: rgba(113, 139, 163, .10); }
.administration-hub-group-system { --administration-group-accent: #d8893c; --administration-group-tint: rgba(216, 137, 60, .10); }
.administration-hub-group-security { --administration-group-accent: #45ad97; --administration-group-tint: rgba(69, 173, 151, .10); }

.administration-hub-group-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .7rem; min-width: 0; padding: .05rem .1rem; }
.administration-hub-icon { width: 2.15rem; height: 2.15rem; flex: 0 0 auto; padding: .42rem; overflow: visible; border: 1px solid currentColor; border-radius: .55rem; color: var(--administration-group-accent, var(--color-primary)); background: transparent; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.administration-hub-group-heading > div, .administration-hub-card-copy { display: grid; gap: .12rem; min-width: 0; }
.administration-hub-group-heading h2, .administration-hub-group-heading p, .administration-hub-group-heading span { margin: 0; overflow-wrap: anywhere; }
.administration-hub-group-heading h2 { font-size: clamp(.98rem, 1.6vw, 1.14rem); }
.administration-hub-group-heading span { color: var(--color-muted); font-size: .77rem; }
.administration-hub-group-heading > b { display: inline-grid; min-width: 2rem; min-height: 2rem; place-items: center; padding: .2rem .48rem; border: 1px solid var(--administration-group-accent); border-radius: 999px; color: var(--administration-group-accent); background: var(--color-surface-elevated); font-size: .8rem; font-variant-numeric: tabular-nums; }

.administration-hub-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .7rem; min-width: 0; }
.administration-hub-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .7rem; min-width: 0; min-height: 6.65rem; padding: .8rem .85rem; border: 1px solid var(--color-border); border-left: 3px solid var(--administration-group-accent); border-radius: var(--radius); color: var(--color-text); background: var(--color-surface-elevated); text-decoration: none; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.administration-hub-card:hover, .administration-hub-card:focus-visible { border-color: var(--administration-group-accent); color: var(--color-text); background: var(--color-surface-soft); transform: translateY(-2px); }
.administration-hub-card:focus-visible { outline: 2px solid var(--administration-group-accent); outline-offset: 2px; }
.administration-hub-card .administration-hub-icon { width: 2.1rem; height: 2.1rem; }
.administration-hub-card strong, .administration-hub-card small { overflow-wrap: anywhere; }
.administration-hub-card strong { font-size: .9rem; }
.administration-hub-card small { color: var(--color-muted); font-size: .73rem; line-height: 1.38; }
.administration-hub-card-arrow { color: var(--administration-group-accent); font-size: 1.15rem; font-weight: 800; }

body.theme-light .administration-hub-group-people { --administration-group-accent: #2777ae; --administration-group-tint: rgba(39, 119, 174, .07); }
body.theme-light .administration-hub-group-operation { --administration-group-accent: #267c4b; --administration-group-tint: rgba(38, 124, 75, .07); }
body.theme-light .administration-hub-group-financial { --administration-group-accent: #6d54b3; --administration-group-tint: rgba(109, 84, 179, .07); }
body.theme-light .administration-hub-group-configuration { --administration-group-accent: #536f8b; --administration-group-tint: rgba(83, 111, 139, .07); }
body.theme-light .administration-hub-group-system { --administration-group-accent: #a85d1f; --administration-group-tint: rgba(168, 93, 31, .07); }
body.theme-light .administration-hub-group-security { --administration-group-accent: #187b69; --administration-group-tint: rgba(24, 123, 105, .07); }

body.theme-contrast .administration-hub-group { --administration-group-tint: transparent; border-width: 2px 2px 2px 5px; }
body.theme-contrast .administration-hub-group-people { --administration-group-accent: #63d8ff; }
body.theme-contrast .administration-hub-group-operation { --administration-group-accent: #7fff86; }
body.theme-contrast .administration-hub-group-financial { --administration-group-accent: #e4a8ff; }
body.theme-contrast .administration-hub-group-configuration { --administration-group-accent: #b8dcff; }
body.theme-contrast .administration-hub-group-system { --administration-group-accent: #ffe066; }
body.theme-contrast .administration-hub-group-security { --administration-group-accent: #7fffbd; }
body.theme-contrast .administration-hub-card { border-width: 2px 2px 2px 4px; }
body.theme-contrast .administration-hub-icon { border-width: 2px; }
body.theme-contrast .email-payment-note-validation,
body.theme-contrast .email-payment-note-validation-summary > div,
body.theme-contrast .email-payment-note-validation-items article { border-width: 2px; }
body.theme-contrast .email-payment-note-validation-audit p { border-left-width: 4px; }

@media (max-width: 760px) {
  .administration-hub-hero { align-items: flex-start; flex-direction: column; }
  .administration-hub-hero-note { max-width: none; }
  .administration-hub-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .administration-hub-group { padding: .7rem; }
  .administration-hub-group-heading { gap: .55rem; }
  .administration-hub-group-heading > b { display: none; }
  .administration-hub-card-grid { grid-template-columns: 1fr; }
  .administration-hub-card { min-height: 5.65rem; gap: .6rem; padding: .75rem; }
  .administration-hub-card .administration-hub-icon { width: 2rem; height: 2rem; }
}

/* B10 — Importação de recibos: a mesma linguagem do Arquivo, com menos
   altura por linha e sem criar uma tabela larga em ecrãs estreitos. */
.payroll-import-header { margin-bottom: .7rem; padding: .78rem .9rem; border-top: 3px solid var(--color-primary); }
.payroll-import-header .panel-header { gap: .75rem; margin-bottom: 0; }
.payroll-import-heading { min-width: 0; }
.payroll-import-header .topbar-kicker { margin: 0 0 .1rem; font-size: .68rem; }
.payroll-import-header h2 { font-size: 1.14rem; }
.payroll-import-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .32rem .52rem; margin-top: .34rem; color: var(--color-muted); font-size: .76rem; line-height: 1.35; }
.payroll-import-meta > span:not(.status-pill) { min-width: 0; overflow-wrap: anywhere; }
.payroll-import-file { flex: 1 1 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payroll-import-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .42rem; }
.payroll-import-actions .button { min-height: 26px; padding: .3rem .55rem; font-size: .76rem; }

.metric-grid.payroll-import-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .62rem; margin: 0 0 .7rem; }
.payroll-import-metrics .metric-card { min-width: 0; min-height: 0; padding: .62rem .72rem; border-top-width: 3px; }
.payroll-import-metrics .metric-card span { overflow-wrap: anywhere; font-size: .72rem; line-height: 1.25; }
.payroll-import-metrics .metric-card strong { margin-top: .3rem; font-size: 1.42rem; font-variant-numeric: tabular-nums; }
.payroll-import-metrics .payroll-import-metric-attention { border-top-color: var(--color-danger); }
.payroll-import-metrics .payroll-import-metric-pending { border-top-color: var(--color-warning); }

.payroll-import-alert { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .45rem; margin: 0 0 .65rem; padding: .55rem .7rem; font-size: .78rem; line-height: 1.42; }
.payroll-import-alert strong { font-size: .8rem; }
.payroll-import-validation-panel { margin-top: .7rem; }
.payroll-import-validation-panel .panel-header { align-items: center; margin-bottom: .58rem; }
.payroll-import-validation-panel .panel-header p { font-size: .78rem; }
.payroll-import-guidance { margin: 0 0 .62rem; border: 1px solid var(--color-border); border-radius: .5rem; background: var(--color-surface-soft); }
.payroll-import-guidance > summary { padding: .45rem .6rem; color: var(--color-primary-strong); cursor: pointer; font-size: .75rem; font-weight: 800; }
.payroll-import-guidance > p { margin: 0; padding: 0 .6rem .55rem; color: var(--color-muted); font-size: .74rem; line-height: 1.4; }
.payroll-import-guidance[open] > summary { margin-bottom: .35rem; border-bottom: 1px solid var(--color-border); }

.payroll-import-table { min-width: 0; overflow: visible; }
.payroll-import-table .data-table { min-width: 0; table-layout: fixed; }
.payroll-import-table .data-table th,
.payroll-import-table .data-table td { padding: .56rem .62rem; font-size: .78rem; line-height: 1.35; }
.payroll-import-table .data-table th { font-size: .7rem; }
.payroll-import-validation-table th:nth-child(1),
.payroll-import-validation-table td:nth-child(1) { width: 8%; }
.payroll-import-validation-table th:nth-child(2),
.payroll-import-validation-table td:nth-child(2) { width: 25%; }
.payroll-import-validation-table th:nth-child(3),
.payroll-import-validation-table td:nth-child(3) { width: 25%; }
.payroll-import-validation-table th:nth-child(4),
.payroll-import-validation-table td:nth-child(4) { width: 42%; }
.payroll-import-payment-table th:nth-child(1),
.payroll-import-payment-table td:nth-child(1) { width: 27%; }
.payroll-import-payment-table th:nth-child(2),
.payroll-import-payment-table td:nth-child(2) { width: 16%; }
.payroll-import-payment-table th:nth-child(3),
.payroll-import-payment-table td:nth-child(3) { width: 17%; }
.payroll-import-payment-table th:nth-child(4),
.payroll-import-payment-table td:nth-child(4) { width: 40%; }
.payroll-import-page { color: var(--color-muted); font-weight: 800; font-variant-numeric: tabular-nums; }
.payroll-import-person-cell,
.payroll-import-state-cell { min-width: 0; }
.payroll-import-person-name { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--color-text); line-height: 1.34; overflow-wrap: anywhere; }
.payroll-import-period { display: block; margin-top: .16rem; color: var(--color-text); font-size: .74rem; font-weight: 700; }
.payroll-import-person-cell small,
.payroll-import-state-cell small,
.payroll-import-payment-table small { margin-top: .16rem; font-size: .68rem; line-height: 1.32; }
.payroll-import-state-cell .status-pill { max-width: 100%; white-space: normal; }
.payroll-import-destination { display: -webkit-box; margin-top: .28rem; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--color-muted); font-size: .69rem; line-height: 1.33; overflow-wrap: anywhere; }
.payroll-import-document-title { display: -webkit-box !important; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.payroll-import-correction { display: grid; grid-template-columns: minmax(0, 1fr) minmax(5.7rem, .58fr); gap: .42rem .5rem; min-width: 0; }
.payroll-import-correction .field { min-width: 0; margin: 0; }
.payroll-import-correction .field:first-child,
.payroll-import-correction .checkbox-field { grid-column: 1 / -1; }
.payroll-import-correction input,
.payroll-import-correction select { min-width: 0; width: 100%; padding: .34rem .42rem; font-size: .75rem; }
.payroll-import-correction .field-label { margin-bottom: .14rem; font-size: .67rem; }
.payroll-import-correction .checkbox-field { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: .69rem; line-height: 1.3; }
.payroll-import-confirm-actions { margin-top: .65rem; }

.payroll-import-payments { margin-top: .7rem; }
.payroll-import-payments .archive-disclosure-summary { padding: .72rem .85rem; }
.payroll-import-payments .archive-disclosure-summary strong { font-size: .9rem; }
.payroll-import-payments .archive-disclosure-summary small { font-size: .72rem; }
.payroll-import-payments .archive-disclosure-content { display: grid; gap: .62rem; padding: .72rem .85rem .85rem; }
.payroll-import-bulk-upload { grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.payroll-import-bulk-upload .archive-wide { grid-column: auto; }
.payroll-import-bulk-upload .field { min-width: 0; }
.payroll-import-bulk-upload input[type="file"] { min-width: 0; font-size: .75rem; }
.payroll-import-payment-guidance { margin: 0; }
.payroll-import-document-actions { display: flex !important; flex-wrap: wrap; align-items: flex-start; gap: .35rem; }
.payroll-import-document-actions .payroll-import-document-title { flex-basis: 100%; width: 100%; }
.payroll-import-payment-upload { display: flex; flex-wrap: wrap; align-items: end; gap: .42rem; }
.payroll-import-payment-upload .field { flex: 1 1 11rem; min-width: 0; margin: 0; }
.payroll-import-payment-upload input[type="file"] { min-width: 0; width: 100%; font-size: .73rem; }
.payroll-import-payment-upload .button { min-height: 2rem; padding: .35rem .52rem; font-size: .73rem; }

body.theme-contrast .payroll-import-header,
body.theme-contrast .payroll-import-guidance,
body.theme-contrast .payroll-import-metrics .metric-card,
body.theme-contrast .payroll-import-payments { border-width: 2px; }
body.theme-contrast .payroll-import-header,
body.theme-contrast .payroll-import-metrics .metric-card { border-top-width: 4px; }

@media (max-width: 1180px) {
  .metric-grid.payroll-import-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .metric-grid.payroll-import-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .payroll-import-table .data-table th,
  .payroll-import-table .data-table td { width: 100%; }
  .payroll-import-table .data-table td { grid-template-columns: minmax(0, 1fr); gap: .25rem; padding: .55rem .62rem; }
  .payroll-import-table .data-table td::before { font-size: .66rem; letter-spacing: .035em; }
  .payroll-import-correction-cell { padding-top: .62rem !important; }
  .payroll-import-payment-upload { align-items: stretch; }
}

@media (max-width: 620px) {
  .payroll-import-header .panel-header { align-items: flex-start; flex-direction: column; }
  .payroll-import-actions { justify-content: flex-start; }
  .metric-grid.payroll-import-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payroll-import-metrics .metric-card { padding: .55rem .6rem; }
  .payroll-import-validation-panel .panel-header { align-items: flex-start; flex-direction: column; gap: .42rem; }
  .payroll-import-payments .archive-disclosure-summary { gap: .6rem; padding: .7rem .75rem; }
  .payroll-import-payments .archive-disclosure-summary .status-pill { white-space: nowrap; }
  .payroll-import-payments .archive-disclosure-content { padding: .7rem .75rem .75rem; }
  .payroll-import-bulk-upload { grid-template-columns: 1fr; }
  .payroll-import-bulk-upload .button,
  .payroll-import-payment-upload .button { width: 100%; }
}

@media (max-width: 420px) {
  .payroll-import-meta { gap: .26rem .42rem; }
  .payroll-import-file { flex-basis: 100%; }
  .payroll-import-correction { grid-template-columns: 1fr; }
  .payroll-import-correction .field:first-child,
  .payroll-import-correction .checkbox-field { grid-column: auto; }
}
.dashboard-internal-contacts-body {
  padding: 0.75rem;
  min-width: 0;
}

.data-table.dashboard-internal-contacts-table th,
.data-table.dashboard-internal-contacts-table td {
  padding: 0.5rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.dashboard-internal-contacts-table a {
  min-width: 0;
  overflow-wrap: anywhere;
}
.project-storage-browser-status {
  margin: 0.75rem 0 0;
  color: var(--text-muted, #657488);
  font-size: 0.9rem;
}

.project-storage-browser-status.is-error {
  color: var(--danger, #b42318);
}

.project-storage-browser-renderer {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 210mm;
  height: 297mm;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
