:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --line: #d8e0ea;
  --text: #17202a;
  --muted: #657487;
  --blue: #2563eb;
  --green: #0f8f61;
  --yellow: #a66800;
  --red: #c0352b;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

body:not(.is-authenticated) .app-shell {
  display: none;
}

body.is-authenticated .auth-screen {
  display: none;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  gap: 16px;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f5f7fb 0%, #e7edf5 100%);
}

.login-box {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.13);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: contain;
}

.login-box h1 {
  margin-bottom: 4px;
}

.login-box h2 {
  margin: 0;
  font-size: 18px;
}

.login-box button {
  width: 100%;
}

.login-message {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-lockup img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: contain;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 28px;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.sync-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.save-status {
  color: var(--green);
}

.save-status.is-saving {
  color: var(--yellow);
}

.save-status.is-error {
  color: var(--red);
}

button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  min-height: 38px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.icon-button {
  width: 40px;
  font-size: 20px;
}

.primary-button {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  padding: 0 16px;
}

.link-button {
  min-height: 30px;
  border-color: transparent;
  background: transparent;
  color: var(--blue);
  padding: 0;
}

.page-tabs {
  display: inline-flex;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 16px;
}

.page-tab {
  min-height: 34px;
  padding: 0 14px;
  border-color: transparent;
  background: transparent;
}

.page-tab.is-active {
  background: var(--surface);
  border-color: var(--line);
  color: var(--blue);
}

.page-panel {
  display: none;
}

.page-panel.is-active {
  display: grid;
}

section.page-panel.is-active {
  display: grid;
}

.quickviews.page-panel.is-active {
  display: flex;
}

.grid-wrap.page-panel.is-active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metrics article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metrics strong {
  font-size: 26px;
}

.quickviews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.quickview {
  min-height: 34px;
  padding: 0 12px;
}

.quickview.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.quickview-since {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quickview-since-input {
  min-height: 34px;
  padding: 0 8px;
}

.coordsync-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.coordsync-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.coordsync-filters label.wide {
  grid-column: 1 / -1;
}

.coordsync-filters input {
  min-height: 34px;
  padding: 0 8px;
}

#coordsync-result {
  margin: 12px 0;
}

.sync-preview-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
  font-size: 13px;
}

.coordsync-card {
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--surface, #fff);
}
.coordsync-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.coordsync-head strong {
  font-size: 13px;
}
.coordsync-cargo {
  font-weight: 700;
}
.coordsync-status {
  color: var(--muted);
  font-size: 12px;
}
.coordsync-flag {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.coordsync-flag.ok {
  background: #e7f6ec;
  color: #1a7f43;
}
.coordsync-flag.warn {
  background: #fdeccd;
  color: #9a6700;
}
.coordsync-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 16px;
}
.coordsync-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.coordsync-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.coordsync-value {
  font-size: 12px;
  word-break: break-word;
}

.recruiterqueue {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 130px 100px minmax(360px, 1fr);
  gap: 12px;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.recruiterqueue button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.queue-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 8px;
}

.queue-metrics span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.queue-metrics strong {
  color: var(--text);
  font-size: 16px;
}

.mywork {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.mywork-search {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.mywork-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mywork-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.mywork h2 {
  margin: 0;
  font-size: 18px;
}

.mywork-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.mywork-card {
  min-height: 74px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 6px;
  padding: 12px;
  text-align: left;
}

.mywork-card span {
  color: var(--muted);
  font-size: 12px;
}

.mywork-card strong {
  font-size: 24px;
}

.mywork-card.is-active {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.mywork-list-wrap {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.mywork-list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.mywork-list-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mywork-list {
  display: grid;
  gap: 8px;
}

.mywork-item {
  display: grid;
  grid-template-columns: minmax(70px, 90px) minmax(220px, 1.2fr) minmax(220px, 1fr) minmax(110px, auto);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}

.mywork-item strong,
.mywork-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mywork-main,
.mywork-action {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mywork-main span,
.mywork-action span {
  color: var(--muted);
  font-size: 12px;
}

.coord-tag {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mywork-item {
  border-left-width: 4px;
}
.mywork-item.coord-assign {
  border-left-color: #d97706;
}
.mywork-item.coord-deadline {
  border-left-color: #dc2626;
}
.mywork-item.coord-rescue {
  border-left-color: #b91c1c;
}
.mywork-item.coord-review {
  border-left-color: #6b7280;
}

.mywork-open {
  min-height: 32px;
  padding: 0 10px;
}

.quality {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.quality-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.quality-controls {
  display: flex;
  align-items: end;
  gap: 12px;
}

.quality-controls label {
  min-width: 190px;
}

.quality h2 {
  margin: 0;
  font-size: 18px;
}

.quality-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.quality-card {
  min-height: 74px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 6px;
  padding: 12px;
  text-align: left;
}

.quality-card span {
  color: var(--muted);
  font-size: 12px;
}

.quality-card strong {
  font-size: 24px;
}

.quality-card.is-active {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.quality-list-wrap {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.quality-list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.quality-list-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quality-list {
  display: grid;
  gap: 8px;
}

.quality-item {
  display: grid;
  grid-template-columns: minmax(70px, 90px) minmax(220px, 1fr) minmax(240px, 1fr) minmax(240px, 1fr) minmax(82px, auto);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}

.quality-item strong,
.quality-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.quality-main,
.quality-context {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.quality-main span,
.quality-context span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.quality-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.quality-open {
  min-height: 32px;
  padding: 0 10px;
}

.detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.detail-root {
  display: grid;
  gap: 12px;
}

.quality-normalizer {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.5fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin: 10px 0;
  background: #fbfdff;
}

.quality-normalizer strong,
.quality-normalizer span {
  display: block;
}

.quality-normalizer strong {
  font-size: 13px;
}

.quality-normalizer span {
  color: var(--muted);
  font-size: 12px;
}

.quality-normalizer-examples {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.detail-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.detail-heading h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.detail-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.detail-actions {
  display: flex;
  gap: 8px;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 10px;
}

.detail-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
  min-width: 0;
}

.detail-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.detail-summary strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-workflow {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 10px;
}

.detail-workflow section,
.detail-group,
.detail-history {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}

.detail-workflow h3,
.detail-group h3,
.detail-history h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.detail-issue-list {
  display: grid;
  gap: 6px;
}

.detail-issue {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: white;
}

.detail-issue span {
  color: var(--muted);
  font-size: 12px;
}

.detail-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 10px;
}

.detail-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 8px;
}

.detail-field {
  min-width: 0;
  border-left: 3px solid #94a3b8;
  padding: 5px 8px;
  background: white;
  border-radius: 6px;
}

.detail-field.editable-source {
  border-left-color: var(--blue);
}

.detail-field span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.detail-field strong {
  display: block;
  min-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

/* Clicar no codigo da vaga abre o detalhe 360 */
td.frozen-id-col {
  cursor: pointer;
}
td.frozen-id-col:hover .official-cell {
  text-decoration: underline;
  color: var(--blue);
}

/* Cabecalho de cada origem (LG / eBox / Nodra) */
.detail-group-head {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.detail-group-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.detail-group-head h3 {
  margin: 0;
  font-size: 14px;
}
.detail-sync-btn {
  flex: 0 0 auto;
  border: 1px solid var(--border, #d0d7de);
  background: #fff;
  color: var(--accent, #2563eb);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.detail-sync-btn:hover {
  background: #f3f6fc;
}
.detail-sync-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}
.detail-group-caption {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Faixa de cor por origem do dado */
.detail-group[data-family="LG"] {
  border-left: 4px solid #2563eb;
}
.detail-group[data-family="eBox"] {
  border-left: 4px solid #0f9d8c;
}
.detail-group[data-family="Nodra"] {
  border-left: 4px solid #b45309;
}

/* Chip com a fonte bruta de cada campo */
.detail-source-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 9px;
  font-weight: 800;
  font-style: normal;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

/* Bloco de atribuicao de recrutador no detalhe */
.detail-assign {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f5f8ff;
  margin-bottom: 10px;
}
.detail-assign-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.detail-assign-heading h3 {
  margin: 0;
  font-size: 14px;
}
.detail-assign-heading > div > span {
  color: var(--muted);
  font-size: 12px;
}
.detail-assign-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-assign-row select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  font-size: 13px;
}
.detail-claim-btn {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--accent, #2563eb);
  border-radius: 6px;
  background: var(--accent, #2563eb);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.detail-claim-btn:hover {
  filter: brightness(0.95);
}
.detail-claim-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.sync-preview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.admin-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.admin-heading,
.cell-governance-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-heading h2,
.admin-card h3,
.cell-governance h3 {
  margin: 0;
}

.admin-heading h2 {
  font-size: 18px;
}

.admin-card h3,
.cell-governance h3 {
  font-size: 14px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 10px;
}

.admin-card,
.cell-governance {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}

.admin-card.wide {
  grid-column: 1 / -1;
}

.admin-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.admin-help,
.admin-note {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.admin-metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: white;
}

.admin-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.admin-metrics strong {
  font-size: 20px;
}

.admin-list,
.cell-request-stack {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.admin-list-item,
.cell-request {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: white;
}

.admin-list-item strong,
.admin-list-item span,
.cell-request strong,
.cell-request span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-list-item span,
.cell-request span {
  color: var(--muted);
  font-size: 12px;
}

.admin-user-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  margin-top: 10px;
}

.admin-user-card {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(150px, 180px) minmax(130px, auto);
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: white;
}

.admin-user-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-user-main strong,
.admin-user-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-main span {
  color: var(--muted);
  font-size: 12px;
}

.user-all-cells {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  font-weight: 700;
}

.user-all-cells input,
.cell-permission-grid input {
  width: 16px;
  height: 16px;
}

.cell-permission-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
  max-height: 132px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #fbfdff;
}

.cell-permission-grid.is-disabled {
  opacity: 0.55;
}

.cell-permission-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
}

.cell-permission-grid span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

button.danger {
  border-color: #e0b4b4;
  color: #b03030;
}

.is-hidden {
  display: none !important;
}

.user-recruiter-names {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
}

.user-recruiter-names input {
  width: 100%;
}

.admin-new-user {
  display: grid;
  gap: 12px;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--border, #d9dee5);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.015);
}

.admin-new-user-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.admin-new-user-fields label {
  display: grid;
  gap: 4px;
}

.cell-governance {
  display: grid;
  gap: 8px;
}

.cell-governance-heading {
  margin-bottom: 0;
}

.cell-governance-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cell-change-form {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.cell-request {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.cell-request.pending {
  border-left: 4px solid var(--yellow);
}

.cell-request.approved {
  border-left: 4px solid var(--green);
}

.cell-request.rejected {
  border-left: 4px solid var(--red);
}

.cell-request-actions {
  display: flex;
  gap: 6px;
}

.new-vacancy-review-list {
  max-height: 460px;
  overflow: auto;
}

.mapping-review-stack {
  display: grid;
  gap: 8px;
  max-height: 460px;
  overflow: auto;
}

.mapping-dimensions {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.new-vacancy-item {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(150px, 0.9fr) minmax(130px, 0.7fr) minmax(150px, 0.8fr) minmax(150px, auto);
  gap: 8px;
  align-items: end;
  border-left: 4px solid var(--yellow);
}

.new-vacancy-item.ready {
  border-left-color: var(--green);
}

.new-vacancy-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.new-vacancy-main strong,
.new-vacancy-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-vacancy-main span {
  color: var(--muted);
  font-size: 12px;
}

.mapping-suggestion-box {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid #d9e4f5;
  border-radius: 6px;
  background: #f7faff;
  padding: 6px 8px;
}

.mapping-suggestion-box strong,
.mapping-suggestion-box span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapping-suggestion-box strong {
  color: #1d4ed8;
  font-size: 12px;
}

.mapping-suggestion-box span {
  color: #475569;
  font-size: 11px;
}

.mapping-suggestion-box.high {
  border-color: #98d6b2;
  background: #effaf3;
}

.mapping-suggestion-box.high strong {
  color: #0f5132;
}

.mapping-suggestion-box.medium {
  border-color: #bed3ff;
  background: #f4f7ff;
}

.mapping-suggestion-box.low {
  border-color: #f3d38b;
  background: #fff8e8;
}

.mapping-suggestion-box.low strong {
  color: #8a5a00;
}

.mapping-suggestion-box.none {
  border-color: #e5e7eb;
  background: #f8fafc;
}

.mapping-suggestion-box.none strong {
  color: #64748b;
}

.new-vacancy-item input,
.new-vacancy-item select {
  width: 100%;
  min-height: 32px;
}

.new-vacancy-actions {
  display: grid;
  gap: 6px;
}

.new-vacancy-actions button {
  min-height: 32px;
}

.sync-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sync-heading h2 {
  margin: 0;
  font-size: 18px;
}

.sync-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.sync-summary article,
.sync-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}

.sync-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.sync-summary strong {
  font-size: 24px;
}

.sync-preview-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.sync-section {
  display: grid;
  gap: 8px;
}

.sync-section h3 {
  margin: 0;
  font-size: 14px;
}

.sync-item {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: white;
}

.sync-item.compact {
  display: block;
}

.sync-changes {
  display: grid;
  gap: 4px;
}

.sync-changes span {
  color: var(--muted);
  font-size: 12px;
}

.savedviews {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr) 120px 90px;
  gap: 12px;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.savedviews button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 480px) minmax(190px, 270px) minmax(300px, 1fr) 110px;
  align-items: end;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.column-settings-button {
  width: 100%;
  margin: 0;
}

.cell-filter-control {
  display: grid;
  gap: 6px;
}

.cell-filter-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cell-filter-control button {
  width: 100%;
  padding: 0 12px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-legend {
  min-height: 36px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  display: inline-block;
}

.dot.official {
  background: #94a3b8;
}

.dot.editable {
  background: var(--blue);
}

.dot.calculated {
  background: var(--green);
}

.bulkbar {
  display: grid;
  grid-template-columns: 140px minmax(190px, 260px) 100px minmax(160px, 220px) minmax(220px, 1fr) 100px 90px;
  align-items: end;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.bulkbar strong {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  color: var(--blue);
}

.bulkbar button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

label span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

input,
select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: white;
  color: var(--text);
}

.grid-wrap {
  height: calc(100vh - 240px);
  min-height: 360px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 2300px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.select-col {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 44px;
  min-width: 44px;
  text-align: center;
  background: var(--surface);
}

.select-col input {
  width: 16px;
  min-height: 16px;
}

.frozen-id-col {
  position: sticky;
  left: 44px;
  z-index: 3;
  width: 136px;
  min-width: 136px;
  max-width: 136px;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line);
  box-sizing: border-box;
}

.quality-col {
  width: 118px;
  min-width: 118px;
}

th,
td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 4px 10px;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}

tbody tr {
  height: 20px;
}

tbody td {
  height: 20px;
  max-height: 20px;
  padding: 0 8px;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  color: #2f4053;
  cursor: pointer;
  user-select: none;
}

th.select-col {
  z-index: 7;
  background: var(--surface-2);
}

th.frozen-id-col {
  z-index: 6;
  background: var(--surface-2);
  padding-right: 38px;
  overflow: hidden;
  text-overflow: ellipsis;
}

th.frozen-id-col .filter-button {
  position: absolute;
  right: 5px;
  top: 50%;
  width: 22px;
  min-height: 22px;
  margin-left: 0;
  transform: translateY(-50%);
  padding: 0;
}

th .filter-button {
  width: 24px;
  min-height: 24px;
  margin-left: 6px;
  border-radius: 6px;
  font-size: 12px;
  vertical-align: middle;
}

th.is-filtered .filter-button {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

th.official-field {
  background: #667085;
  color: white;
}

th.editable-field {
  background: #2563eb;
  color: white;
}

th.calculated-field {
  background: #0f5132;
  color: white;
}

th.quality-col {
  background: #0f5132;
  color: white;
}

tbody tr:hover {
  background: #f8fbff;
}

tbody tr.urgency-critical {
  box-shadow: inset 4px 0 0 var(--red);
}

tbody tr.urgency-warning {
  box-shadow: inset 4px 0 0 var(--yellow);
}

tbody tr.urgency-normal {
  box-shadow: inset 4px 0 0 var(--green);
}

.official-cell {
  color: #334155;
  background: #fbfcfe;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  font-weight: 700;
  font-size: 12px;
}

.badge.green {
  background: #e5f7ef;
  color: var(--green);
}

.badge.yellow {
  background: #fff4d6;
  color: var(--yellow);
}

.badge.red {
  background: #ffe8e6;
  color: var(--red);
}

.badge.blue {
  background: #e8f0ff;
  color: var(--blue);
}

.muted {
  color: var(--muted);
}

.cell-observation {
  display: block;
  width: 100%;
  min-width: 260px;
  max-width: 520px;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editable-cell {
  border-radius: 6px;
  height: 20px;
  min-height: 20px;
  max-height: 20px;
  padding: 0 6px;
  line-height: 20px;
  box-shadow: inset 0 0 0 1px transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editable-cell:hover {
  background: #eef6ff;
  box-shadow: inset 0 0 0 1px #b9d8ff;
}

.filter-menu,
.cell-editor,
.history-menu,
.column-menu {
  position: fixed;
  z-index: 20;
  width: 290px;
  max-height: 420px;
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
  padding: 10px;
}

.filter-menu h3,
.cell-editor h3,
.history-menu h3,
.column-menu h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.column-menu {
  width: 390px;
  max-width: calc(100vw - 16px);
}

.column-list {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
}

.column-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 30px 30px;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
}

.column-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.column-row button {
  min-height: 28px;
  padding: 0;
}

.filter-actions,
.editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.filter-search {
  width: 100%;
  min-height: 32px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  font: inherit;
}

.filter-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

.filter-list label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

.filter-list input {
  width: 15px;
  min-height: 15px;
}

.filter-list span {
  margin: 0;
  color: var(--text);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-editor select,
.cell-editor input,
.cell-editor textarea {
  width: 100%;
}

.cell-editor textarea {
  min-height: 120px;
  resize: vertical;
}

.pending-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 260px;
}

.pending-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  background: #fff4d6;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 700;
}

.pending-pill.red {
  background: #ffe8e6;
  color: var(--red);
}

.pending-pill.green {
  background: #e5f7ef;
  color: var(--green);
}

.urgency-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.urgency-pill.critical {
  background: #ffe8e6;
  color: var(--red);
}

.urgency-pill.warning {
  background: #fff4d6;
  color: var(--yellow);
}

.urgency-pill.normal {
  background: #e5f7ef;
  color: var(--green);
}

.validation-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 280px;
}

.validation-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  background: #ffe8e6;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.validation-pill.ok {
  background: #e5f7ef;
  color: var(--green);
}

.validation-pill.warning {
  background: #fff4d6;
  color: var(--yellow);
}

.validation-pill.critical {
  background: #ffe8e6;
  color: var(--red);
}

.quality-indicator {
  display: inline-flex;
  align-items: center;
  max-width: 104px;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quality-indicator.ok {
  background: #e5f7ef;
  color: var(--green);
}

.quality-indicator.warning {
  background: #fff4d6;
  color: var(--yellow);
}

.quality-indicator.critical {
  background: #ffe8e6;
  color: var(--red);
}

.editable-cell:focus {
  background: #eef6ff;
  outline: 2px solid #9cc7ff;
  outline-offset: -1px;
}

.action-cell {
  display: grid;
  gap: 3px;
  max-width: 260px;
}

.action-cell strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-cell span {
  color: var(--muted);
  font-size: 12px;
}

.history-button,
.detail-button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.history-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  font-size: 12px;
}

.history-list strong {
  display: block;
  margin-bottom: 3px;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-lockup {
    min-width: 0;
  }

  .quality-heading,
  .quality-controls,
  .detail-heading,
  .detail-actions,
  .sync-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics,
  .toolbar,
  .recruiterqueue,
  .mywork-grid,
  .mywork-item,
  .quality-summary,
  .quality-item,
  .detail-summary,
  .detail-workflow,
  .detail-groups,
  .detail-fields,
  .quality-normalizer,
  .sync-summary,
  .admin-grid,
  .admin-metrics,
  .admin-user-card,
  .cell-change-form,
  .new-vacancy-item,
  .savedviews,
  .bulkbar {
    grid-template-columns: 1fr;
  }

  .cell-permission-grid {
    grid-template-columns: 1fr;
  }

  .grid-wrap {
    height: 58vh;
  }
}

/* Fila priorizada: scroll + sub-linha (estabelecimento/UO) + contador */
.mywork-list {
  max-height: 60vh;
  overflow-y: auto;
}
.mywork-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.mywork-count {
  margin: 0 0 8px;
  font-size: 12px;
  position: sticky;
  top: 0;
  background: var(--surface);
  padding: 4px 0;
  z-index: 1;
}

/* Seção eBox no detalhe da vaga */
.detail-ebox {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--surface);
}
.detail-ebox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
  margin: 8px 0;
}
.detail-ebox-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.detail-ebox-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.detail-ebox-docs > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.ebox-docs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.ebox-doc-pill {
  font-size: 12px;
  background: #fdeceb;
  color: var(--red);
  border: 1px solid #f3c9c5;
  border-radius: 6px;
  padding: 2px 8px;
}

/* Tabela de acoes em massa na aba Prioridades */
.mywork-table-wrap {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.mywork-bulkbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 10px;
}
.mywork-bulkbar label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.mywork-bulkbar select {
  min-height: 34px;
  min-width: 180px;
}
.mywork-table-scroll {
  max-height: 60vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.mywork-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  white-space: nowrap;
}
.mywork-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 1;
}
.mywork-table tbody td {
  border-bottom: 1px solid var(--line);
  padding: 6px 10px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mywork-table tbody tr:hover {
  background: var(--surface-2);
}
.mywork-table .select-col {
  width: 36px;
  text-align: center;
}

/* Shadow mode: banner global + toggle no admin */
.shadow-banner {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #fff;
  background: var(--red);
  border-radius: 6px;
  padding: 4px 10px;
}
.shadow-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.shadow-toggle input { width: 16px; height: 16px; cursor: pointer; }
.sync-status.is-shadow-on {
  color: var(--red);
  font-weight: 700;
}

/* RQ + status na fila priorizada do coordenador/recrutador */
.mywork-meta {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: var(--surface-2);
  border-radius: 6px;
  padding: 2px 8px;
}

/* ===== Skeleton de carregamento (pos-login, enquanto os dados chegam) ===== */
@keyframes nodra-shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

.skeleton-line,
body.is-loading-data .metrics strong,
body.is-loading-data .queue-metrics strong,
body.is-loading-data .mywork-card strong {
  background: linear-gradient(90deg, var(--surface-2) 25%, #e3eaf3 37%, var(--surface-2) 63%);
  background-size: 200px 100%;
  animation: nodra-shimmer 1.2s ease-in-out infinite;
  border-radius: 6px;
}

/* contadores viram blocos shimmer (esconde o "0" sem mexer no HTML) */
body.is-loading-data .metrics strong,
body.is-loading-data .queue-metrics strong,
body.is-loading-data .mywork-card strong {
  color: transparent;
  display: inline-block;
  user-select: none;
}
body.is-loading-data .metrics strong { width: 64px; height: 26px; }
body.is-loading-data .mywork-card strong { width: 48px; height: 24px; }
body.is-loading-data .queue-metrics strong { width: 28px; height: 16px; }

/* linhas skeleton para a fila de prioridades */
.skeleton-line {
  height: 14px;
  border-radius: 6px;
}
.skeleton-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--surface);
}
.skeleton-item .skeleton-line.title { width: 45%; height: 16px; }
.skeleton-item .skeleton-line.sub { width: 70%; }
.skeleton-item .skeleton-line.tag { width: 30%; height: 12px; }

@media (prefers-reduced-motion: reduce) {
  .nodra-skel,
  body.is-loading-data .metrics strong,
  body.is-loading-data .queue-metrics strong,
  body.is-loading-data .mywork-card strong,
  .skeleton-line { animation: none; }
}

/* Prioridades: foco na tabela + filtros rapidos compactos (chips) */
.mywork .mywork-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.mywork .mywork-card {
  min-height: 34px;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-items: initial;
  gap: 8px;
  padding: 0 12px;
  width: auto;
}
.mywork .mywork-card span {
  font-size: 13px;
  color: inherit;
}
.mywork .mywork-card strong {
  font-size: 13px;
  width: auto;
  height: auto;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  animation: none;
  display: inline-block;
  user-select: auto;
}
.mywork .mywork-card.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  box-shadow: none;
}
.mywork .mywork-card.is-active span,
.mywork .mywork-card.is-active strong {
  color: white;
}
.mywork .mywork-card.is-active strong {
  background: rgba(255, 255, 255, 0.25);
}
