/* Final shared geometry layer. Company colours do not change control dimensions. */
body[data-company] .formgrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
body[data-company] :is(.formgrid, .issue-filters) > label {
  min-width: 0;
  align-content: start;
}
body[data-company] .ux-field-caption {
  display: block;
  line-height: 18px;
  overflow-wrap: anywhere;
}
body[data-company] .ux-form-section label:has(.ux-required) > .ux-field-caption {
  padding-right: 65px;
}
body[data-company]
  form
  :is(input:not([type='checkbox']):not([type='radio']):not([type='hidden']):not([type='file']), select) {
  height: 44px;
  min-height: 44px;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 20px;
}
body[data-company] .ux-combobox {
  margin: 0;
  min-width: 0;
}
body[data-company] .ux-combo-control {
  position: relative;
  min-width: 0;
  height: 44px;
}
body[data-company] .ux-combo-control > input {
  display: block;
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 10px 44px 10px 12px;
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  border-radius: 8px;
  background: #fff;
}
body[data-company] .ux-combo-control > .ux-combo-clear {
  position: absolute;
  inset: 4px 4px auto auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0;
  line-height: 1;
  border: 0;
  border-radius: 5px;
  box-shadow: none;
  background: transparent;
  font-size: 18px;
  transform: none;
}
body[data-company] .ux-combo-control > .ux-combo-clear:hover:not(:disabled) {
  background: #eaf4ef;
  box-shadow: none;
}
body[data-company] .ux-combo-control > .ux-combo-options {
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
}
body[data-company] .ux-combobox > small {
  margin: 4px 0 0;
  min-height: 16px;
  line-height: 16px;
}
body[data-company] .ux-combo-options button {
  padding: 9px 10px;
  min-height: 38px;
  line-height: 20px;
  overflow-wrap: anywhere;
}
body[data-company] .formgrid :is(input, select, textarea) {
  min-width: 0;
  max-width: 100%;
}
body[data-company] .panelhead {
  align-items: center;
  flex-wrap: wrap;
}
body[data-company] .panelhead > div:first-child {
  min-width: 0;
}
body[data-company] :is(.actions, .formactions, .op-actions) {
  align-items: center;
}
body[data-company] .tabletools {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
body[data-company] .tabletools > label {
  flex: 1 1 220px;
  min-width: 0;
}
body[data-company] .tabletools :is(input, button) {
  min-height: 40px;
  height: 40px;
  margin: 0;
}
body[data-company] .tablewrap th {
  vertical-align: top;
}
body[data-company] .tablewrap th .columnfilter {
  height: 34px;
  min-height: 34px;
  line-height: 18px;
  margin-top: 6px;
}
body[data-company] .ux-row-actions {
  align-items: flex-start;
}
body[data-company] .ux-row-actions > button,
body[data-company] .ux-more-actions > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  line-height: 18px;
  padding: 9px 11px;
  font-size: 12px;
  margin: 0;
}
body[data-company] .list-pagination :is(select, button) {
  height: 40px;
  min-height: 40px;
  margin: 0;
}
body[data-company] .list-pagination > div {
  display: flex;
  gap: var(--control-gap, 8px);
  align-items: center;
  flex-wrap: wrap;
}
body[data-company] .issue-filters > button {
  height: 44px;
  min-height: 44px;
}
body[data-company] .issue-dashboard-filter button {
  margin: 0;
  min-height: 44px;
}
body[data-company] .detailgrid > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  body[data-company] .formgrid {
    grid-template-columns: minmax(0, 1fr);
  }
  body[data-company] .ux-combo-control > input {
    font-size: 16px;
  }
  body[data-company] .ux-combo-options button {
    min-height: 44px;
  }
  body[data-company] .panelhead {
    align-items: flex-start;
  }
  body[data-company] .tablewrap td > span {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  body[data-company] .ux-row-actions > button,
  body[data-company] .ux-more-actions > summary {
    min-height: 44px;
  }
}
/* Keep a single clear action: browsers otherwise add a second native ×. */
body[data-company] .ux-combo-control > input[type='search'] {
  appearance: textfield;
  -webkit-appearance: textfield;
}
body[data-company] .ux-combo-control > input::-webkit-search-cancel-button,
body[data-company] .ux-combo-control > input::-webkit-search-decoration {
  display: none;
  -webkit-appearance: none;
}
body[data-company] .ux-combo-options button {
  border: 0;
  border-radius: 5px;
  box-shadow: none;
  background: transparent;
}
body[data-company] .ux-combo-options button:hover,
body[data-company] .ux-combo-options button.ux-highlight,
body[data-company] .ux-combo-options button[aria-selected='true'] {
  background: #e8f5ef;
  color: #126a53;
  box-shadow: none;
}

/* Weekly entry: one accessible row for day and night, including on mobile. */
.week-hours-grid {
  display: grid;
  gap: var(--control-gap, 8px);
  margin: 20px 0;
}
.week-hours-row,
.week-hours-heading {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) repeat(2, minmax(80px, 1fr));
  gap: 10px;
  align-items: end;
}
.week-hours-heading {
  font-weight: 600;
  color: var(--muted, #50646b);
}
.week-hours-row {
  padding: 10px;
  border: 1px solid #dce5e6;
  border-radius: 10px;
}
.week-hours-row label {
  min-width: 0;
  margin: 0;
}
.week-hours-row input {
  width: 100%;
  min-width: 0;
}
.week-holiday {
  grid-column: 1/-1;
}
.week-holiday:empty {
  display: none;
}
.week-hours-row.is-holiday {
  background: #fff8e8;
  border-color: #e1bf74;
}
.week-hours-row.is-holiday .week-holiday {
  color: #684700;
}
@media (max-width: 560px) {
  .week-hours-heading {
    display: none;
  }
  .week-hours-row {
    grid-template-columns: 1fr 1fr;
  }
  .week-hours-row > label:first-child {
    grid-column: 1/-1;
  }
}

/* Candidate forms reuse the app's fields and mobile grid. */
.candidate-section {
  min-width: 0;
  border: 1px solid #dce5e6;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
}
.candidate-section legend {
  font-weight: 650;
  padding: 0 8px;
}
.candidate-checks {
  border: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
}
.candidate-checks legend {
  margin-bottom: 10px;
}
.candidate-checks label {
  display: flex;
  align-items: center;
  gap: 9px;
}
.candidate-checks input {
  width: auto;
  margin: 0;
}
@media (max-width: 600px) {
  .candidate-checks {
    grid-template-columns: 1fr;
  }
  .candidate-section {
    padding: 14px;
  }
}
.candidate-status-chart {
  display: grid;
  gap: 12px;
  padding: 20px;
}
.candidate-status-bar {
  display: grid;
  grid-template-columns: minmax(130px, 1.2fr) 45px minmax(100px, 2fr) 55px;
  align-items: center;
  gap: 16px;
  text-align: left;
  padding: 16px;
  border: 1px solid #dce5e6;
  border-radius: 12px;
  background: transparent;
}
.candidate-status-bar:hover {
  background: #edf6f4;
}
.candidate-status-bar progress {
  width: 100%;
  height: 14px;
  accent-color: #087d78;
}
.candidate-status-bar strong {
  font-size: 20px;
}
@media (max-width: 600px) {
  .candidate-status-bar {
    grid-template-columns: 1fr 45px;
  }
  .candidate-status-bar progress {
    grid-column: 1;
  }
  .candidate-status-bar small {
    grid-column: 2;
  }
}

.employee-validity-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.employee-validity-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: var(--control-gap, 8px);
  padding: 18px;
  border: 1px solid currentColor;
  border-radius: 14px;
  min-width: 0;
}
.employee-validity-card strong {
  font-size: 2rem;
}
.employee-validity-card small {
  color: inherit;
}
.employee-validity-tag {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 7px;
  font-weight: 600;
}
.employee-validity-card.month6,
.employee-validity-tag.month6 {
  background: #fff8d7;
  color: #6d5200;
}
.employee-validity-card.month3,
.employee-validity-tag.month3 {
  background: #fff0df;
  color: #943f08;
}
.employee-validity-card.month1,
.employee-validity-card.expired,
.employee-validity-tag.month1,
.employee-validity-tag.expired {
  background: #ffebe9;
  color: #a32922;
}
.employee-validity-card.valid,
.employee-validity-tag.valid {
  background: #e8f6f0;
  color: #185e4d;
}
.employee-validity-card.missing,
.employee-validity-tag.missing {
  background: #edf1f3;
  color: #45545f;
}
@media (max-width: 650px) {
  .employee-validity-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .employee-validity-card {
    padding: 12px;
  }
}

body #nav .nav-submenu {
  border: 0;
  margin: 0;
  padding: 0;
}
body #nav .nav-submenu > summary {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  color: inherit;
  cursor: pointer;
}
body #nav .nav-submenu > div {
  margin-left: 12px;
  padding-left: 8px;
  border-left: 1px solid #ffffff24;
}
body #nav .nav-submenu > div a {
  font-size: 12px;
}
body #nav .nav-submenu:not([open]) > summary::before {
  transform: none;
}
body #nav .nav-submenu[open] > summary::before {
  transform: rotate(90deg);
}

/* Keep employee indicators and creation actions in the first viewport. */
body.employee-dashboard-view main > header {
  min-height: 0;
  padding-top: 10px;
  padding-bottom: 10px;
}
body.employee-dashboard-view .heading {
  margin-top: 12px;
  margin-bottom: 4px;
  padding-top: 0;
  padding-bottom: 0;
}
body.employee-dashboard-view .heading h1 {
  margin-bottom: 4px;
}
body.employee-dashboard-view #subtitle {
  margin-top: 0;
  margin-bottom: 4px;
}
body.employee-dashboard-view .qa-identity-status {
  margin-top: 0;
  margin-bottom: 8px;
  padding-top: 0;
  padding-bottom: 0;
}
body.employee-dashboard-view .module-navigation {
  margin-top: 4px;
  margin-bottom: 10px;
}
.employee-dashboard-content #employeeDashboardIndicators {
  padding-top: 8px;
  padding-bottom: 10px;
}
.employee-dashboard-content .metrics {
  margin: 0;
  gap: 10px;
}
.employee-dashboard-content .metric {
  padding: 12px;
}
.employee-dashboard-content .employee-validity-cards {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--control-gap, 8px);
  margin-top: 10px;
}
.employee-dashboard-content .employee-validity-card {
  padding: 10px;
  gap: 4px;
  border-radius: 10px;
}
.employee-dashboard-content .employee-validity-card strong {
  font-size: 1.5rem;
}
#employeeDashboardFilter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding-top: 8px;
  padding-bottom: 8px;
}
#employeeDashboardFilter .formgrid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  flex: 1;
}
#employeeDashboardFilter label {
  flex: 1;
  min-width: 170px;
  margin: 0;
}
#employeeDashboardFilter button {
  margin: 0;
}
.employee-dashboard-help {
  margin: 8px 16px 16px;
}
.employee-dashboard-help summary {
  cursor: pointer;
  font-weight: 600;
}
.employee-dashboard-help p {
  line-height: 1.5;
}
.employee-created-prompt {
  padding: 4px 0;
}
@media (max-width: 1100px) {
  .employee-dashboard-content .employee-validity-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .employee-dashboard-content .employee-validity-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #employeeDashboardFilter .formgrid {
    flex-basis: 100%;
  }
  .employee-created-prompt .formactions {
    display: grid;
  }
}

/* One heading and one action group for the employee overview. */
#employeePageActions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--control-gap, 8px);
}
#employeePageActions .employee-list-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid #cbd7d9;
  border-radius: 10px;
  background: #fff;
  color: #263e48;
  text-decoration: none;
  font-size: var(--text-caption, 0.875rem);
  font-weight: 600;
  line-height: 1.2;
}
#employeePageActions .employee-list-link:hover {
  background: #f0f6f5;
}
#employeePageActions .employee-list-link:focus-visible {
  outline: 2px solid var(--brand, #117b70);
  outline-offset: 3px;
}
.employee-dashboard-content .employee-overview {
  padding-top: 8px;
}
body.employee-dashboard-view .heading {
  align-items: center;
  gap: 16px;
}
@media (max-width: 900px) {
  body.employee-dashboard-view .heading {
    flex-direction: column;
    align-items: stretch;
  }
  #employeePageActions {
    width: 100%;
  }
}
@media (max-width: 600px) {
  #employeePageActions > * {
    flex: 1 1 auto;
  }
}

.employee-current-location {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Shared panel hierarchy: page title once, task actions kept beside the content. */
body[data-company] .panelhead.ux-compact-panelhead {
  padding-block: 12px;
  gap: 12px;
}
body[data-company] .panelhead.ux-compact-panelhead p {
  margin: 0;
}
body[data-company] :is(.actions, .formactions, .op-actions) {
  display: flex;
  flex-wrap: wrap;
  gap: var(--control-gap, 8px);
}
body[data-company] :is(.actions, .formactions, .op-actions) > :is(button, .button) {
  margin: 0;
  min-block-size: var(--control-height, 40px);
}

/* Readable names and scalable supporting text; keep the monthly sheet horizontal. */
body[data-company]
  .tablewrap:not(.monthly-grid)
  td:is([data-label='Colaborador'], [data-label='Employee'], [data-label='Nome'], [data-label='Name']) {
  min-inline-size: 12rem;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.5;
}
body[data-company] :is(.formgrid, .panelhead) :is(small, .muted) {
  font-size: var(--text-caption, 0.875rem);
  line-height: 1.5;
}
@media (pointer: coarse), (max-width: 900px) {
  body[data-company]
    :is(
      button,
      select,
      input:not([type='checkbox']):not([type='radio']):not([type='hidden']),
      summary,
      .ux-page-tabs a,
      .formactions a
    ) {
    min-block-size: var(--touch-target, 44px);
    height: auto;
  }
  body[data-company] :is(input, select, textarea):not([type='checkbox']):not([type='radio']) {
    font-size: max(1rem, 16px);
  }
  body[data-company] .check {
    min-block-size: var(--touch-target, 44px);
    align-items: center;
  }
  body[data-company] .tabletools {
    flex-wrap: wrap;
  }
}

#mobileNavBackdrop {
  position: fixed;
  inset: 0;
  z-index: 49;
  border: 0;
  border-radius: 0;
  background: #10282cb3;
  width: 100%;
  height: 100%;
}
@media (max-width: 900px) {
  body.mobile-nav-open {
    overflow-y: hidden;
  }
  body.mobile-nav-open aside {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(360px, 92vw);
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  body.mobile-nav-open #activityMenuToggle {
    position: sticky;
    top: 0;
    z-index: 1;
  }
}
