:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --line: #dce3eb;
  --line-strong: #c8d2de;
  --text: #16202a;
  --muted: #6b7a89;
  --brand: #0a684f;
  --brand-soft: #e7f4ef;
  --blue: #2563eb;
  --blue-soft: #e8f0ff;
  --green: #1f7a3f;
  --green-soft: #e9f6ed;
  --amber: #b4690e;
  --amber-soft: #fff2df;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --font-sans: "Segoe UI", Aptos, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand);
  color: #ffffff;
  flex-shrink: 0;
}

.topbar-mark svg {
  width: 18px;
  height: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 14px;
  line-height: 1.1;
  font-weight: 700;
}

.topbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.topbar-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.filters,
.stats-strip,
.table-panel,
.detail-panel {
  margin-top: 10px;
}

.filters {
  padding: 10px 12px;
}

.filters-row {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.7fr)
    minmax(180px, 1.2fr)
    repeat(8, minmax(110px, 1fr))
    minmax(120px, auto);
  gap: 8px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.field input,
.field select,
.ghost-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text);
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: #99c4b8;
  background: var(--surface);
}

.ghost-button {
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
}

.stats-card {
  padding: 8px 12px;
  border-right: 1px solid var(--line);
}

.stats-card:last-child {
  border-right: 0;
}

.stats-card p {
  margin: 0;
}

.stats-card-label {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stats-card-value {
  margin-top: 2px;
  color: var(--brand);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
}

.stats-card-note {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 0;
}

.panel-head strong,
.detail-empty strong,
.detail-title {
  font-size: 13px;
  font-weight: 700;
}

.panel-caption {
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
  padding: 8px 12px 12px;
}

table {
  width: 100%;
  min-width: 1500px;
  border-collapse: collapse;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 10px;
  background: #f2f5f8;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
}

tbody td {
  padding: 10px;
  border-bottom: 1px solid #edf1f5;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.35;
}

tbody tr {
  cursor: pointer;
}

tbody tr:nth-child(4n + 1):not(.detail-row),
tbody tr:nth-child(4n + 2):not(.detail-row) {
  background: #fcfdff;
}

tbody tr:hover,
tbody tr.is-active {
  background: #f2f9f6;
}

tbody tr.is-active td:first-child {
  box-shadow: inset 3px 0 0 var(--brand);
}

.orgao-cell strong,
.concurso-cell strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.table-subtle {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.number-cell,
.salary-cell {
  white-space: nowrap;
  font-weight: 700;
}

.salary-cell {
  color: var(--brand);
}

.tag-list,
.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.tag {
  background: #eef3f7;
  color: #526272;
}

.badge {
  background: #eef3f7;
  color: #526272;
}

.badge-status-realizado {
  background: var(--green-soft);
  color: var(--green);
}

.badge-status-previsto {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-status-em-andamento {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge-esfera-federal {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge-esfera-estadual {
  background: var(--brand-soft);
  color: var(--brand);
}

.badge-esfera-municipal {
  background: #fff4e7;
  color: #9f6113;
}

.detail-panel {
  padding: 10px 12px 12px;
}

.detail-row td {
  padding: 0;
  background: #f7fafc;
  border-bottom: 1px solid var(--line-strong);
}

.inline-detail {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.detail-empty p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.detail-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.detail-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.detail-table {
  min-width: 1320px;
}

.detail-table thead th {
  background: #eef3f8;
}

.detail-table tbody tr {
  cursor: default;
  background: #ffffff;
}

.detail-table tbody tr:hover {
  background: transparent;
}

.detail-table tbody td {
  vertical-align: top;
  padding: 10px 10px 8px;
}

.detail-table td:nth-child(1) {
  width: 17%;
}

.detail-table td:nth-child(2) {
  width: 5%;
}

.detail-table td:nth-child(3) {
  width: 8%;
}

.detail-table td:nth-child(4) {
  width: 7%;
}

.detail-table td:nth-child(5) {
  width: 10%;
}

.detail-table td:nth-child(6) {
  width: 53%;
}

.empty-row {
  padding: 16px 10px;
  text-align: center;
  color: var(--muted);
}

.status-message {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 1400px) {
  .filters-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .page-shell {
    padding: 8px;
  }

  .topbar,
  .panel-head,
  .detail-topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .filters-row,
  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .filters-row,
  .stats-strip {
    grid-template-columns: 1fr;
  }
}
