/*style.css*/
* {
  box-sizing: border-box;
}

:root {
  --bg: #eef2f6;
  --card: #ffffff;
  --text: #162033;
  --muted: #68758c;
  --line: #e7ebf1;
  --line-2: #edf1f6;
  --primary: #3f67db;
  --primary-dark: #2f55c4;
  --soft: #f7f9fc;
  --soft-2: #f2f5fa;
  --shadow: 0 8px 24px rgba(23, 37, 84, 0.06);
  --radius: 18px;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  min-height: 100vh;
}

/* topo */
.topbar {
  width: calc(100% - 32px);
  margin: 20px auto 14px;
  padding: 22px 24px;
  background: #f8fafc;
  border-radius: 20px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.brand-text h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #162033;
}

.brand-text p {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.acc-label {
  font-size: 14px;
  color: #23304a;
}

.acc-btn {
  border: 0;
  background: #ffffff;
  color: #24314c;
  height: 42px;
  min-width: 42px;
  padding: 0 14px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

/* página */
.page-wrap {
  width: calc(100% - 32px);
  margin: 0 auto 24px;
}

/* card filtros */
.filters-card {
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 26px 26px 24px;
  margin-bottom: 18px;
}

.filters-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1fr 1fr auto;
  gap: 18px;
  align-items: end;
}

.filter-field label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}

.filter-field select {
  width: 100%;
  height: 48px;
  border: 1px solid #d9e0ea;
  border-radius: 14px;
  background: #fff;
  padding: 0 16px;
  font-size: 15px;
  color: #182236;
  outline: none;
}

.filter-field select:focus {
  border-color: #bdd0f8;
  box-shadow: 0 0 0 3px rgba(63, 103, 219, 0.08);
}

.filter-action {
  display: flex;
  align-items: flex-end;
}

.btn-search {
  height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 18px;
  background: #edf2f8;
  color: #22304a;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-search:hover {
  background: #e5ebf3;
  transform: translateY(-1px);
}

.btn-search-icon {
  font-size: 16px;
}

/* card lista */
.list-card {
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 26px 26px 18px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.section-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #eef3fb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.section-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: #1b2436;
}

.section-head p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* tabela */
.modern-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

.modern-table thead th {
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: #607089;
  background: #eef2f7;
  padding: 14px 18px;
  border-bottom: 1px solid #e1e7ef;
}

.modern-table thead th:first-child {
  border-top-left-radius: 14px;
}

.modern-table thead th:last-child {
  border-top-right-radius: 14px;
}

.modern-table tbody td {
  padding: 18px 18px;
  border-bottom: 1px solid var(--line-2);
  font-size: 15px;
  color: #1c2739;
  vertical-align: middle;
}

.modern-table tbody tr:hover {
  background: #fafbfd;
}

/* botão lupa */
.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #edf2f7;
  color: #22304a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.15s ease;
}

.icon-btn:hover {
  background: #e3e9f1;
  transform: translateY(-1px);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

/*inclusão*/
/* backdrop/modal */
#backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.28);
  backdrop-filter: blur(2px);
  display: none;
  z-index: 999;
}

#modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(700px, calc(100vw - 32px));
  max-height: 86vh;
  overflow: auto;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  display: none;
  z-index: 1000;
}




/*
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 26px 28px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-title-block h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: #172235;
  letter-spacing: -0.01em;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--muted);
}*/

.modal-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #f3f6fa;
  color: #1f2b40;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.15s ease;
}

.modal-close:hover {
  background: #e8edf4;
  transform: translateY(-1px);
}
/*
.modal-body {
  padding: 22px 28px 28px;
}

.modal-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.info-box {
  background: #f8fafd;
  border: 1px solid #ecf0f5;
  border-radius: 16px;
  padding: 14px 16px;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
*/


.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid #edf1f6;
}

.modal-title-block h3,
#nomeServidor {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
  color: #172235;
  letter-spacing: -0.01em;
}

.modal-subtitle,
#modalCargo {
  font-size: 13px;
  color: #6f7c91;
  line-height: 1.35;
}

.modal-body {
  padding: 18px 24px 24px;
}

.modal-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.info-box {
  background: #ffffff;
  border: 1px solid #e8edf4;
  border-radius: 14px;
  padding: 12px 14px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.info-label {
  display: block;
  font-size: 12px;
  color: #6f7c91;
  margin-bottom: 5px;
}

.info-value {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #182236;
}

/*.info-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 7px;
}

.info-value {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #182236;
}*/

.modal-section-title {
  margin: 6px 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: #192438;
}

/* accordion do modal */
#categoriaList details.cat-acc {
  margin: 12px 0;
  border: 1px solid #e8edf4;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

#categoriaList details.cat-acc > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  background: #f8fafd;
  border-bottom: 1px solid #edf1f6;
  font-weight: 700;
  position: relative;
}

#categoriaList details.cat-acc > summary::-webkit-details-marker {
  display: none;
}

#categoriaList details.cat-acc > summary::before {
  content: "▸";
  font-size: 14px;
  color: #52637c;
  transition: transform 0.18s ease;
}

#categoriaList details.cat-acc[open] > summary::before {
  transform: rotate(90deg);
}

#categoriaList .cat-title {
  margin-right: auto;
  font-size: 16px;
  color: #1d2940;
  line-height: 1.3;
}

#categoriaList .cat-total {
  font-size: 15px;
  font-weight: 800;
  color: #111827; /* sempre preto */
}

#categoriaList .rub-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

#categoriaList .rub-table thead tr {
  background: #fbfcfe;
}

#categoriaList .rub-table th,
#categoriaList .rub-table td {
  padding: 12px 14px;
  border-top: 1px solid #edf1f6;
  font-size: 14px;
}

#categoriaList .rub-table th {
  text-align: left;
  color: #607089;
  font-weight: 700;
}

#categoriaList .rub-table td {
  color: #1c2739;
}

#categoriaList .rub-table .col-cod {
  width: 90px;
}

#categoriaList .rub-table .col-val {
  width: 150px;
  text-align: right;
  font-weight: 700;
  color: #111827; /* sempre preto */
}

@media (max-width: 780px) {
  .modal-info-grid {
    grid-template-columns: 1fr;
  }

  #modal {
    width: calc(100vw - 20px);
  }
}

#categoriaList .rub-list {
  padding: 8px 18px 14px;
  background: #fff;
}

#categoriaList .rub-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #edf1f6;
}

#categoriaList .rub-row:first-child {
  border-top: 0;
}

#categoriaList .rub-desc-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#categoriaList .rub-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7db4ff;
  flex: 0 0 auto;
}

#categoriaList .rub-desc {
  font-size: 14px;
  color: #1c2739;
  line-height: 1.45;
}

#categoriaList .rub-val {
  font-size: 14px;
  font-weight: 400;
  color: #111827;
  white-space: nowrap;
  text-align: right;
}

#categoriaList .rub-empty {
  padding: 8px 0 2px;
  font-size: 14px;
  color: #7b8798;
}

#categoriaList .cat-total {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}

#categoriaList details.cat-acc.liquido-final > summary {
  background: #eef3fb;
}

#categoriaList details.cat-acc.liquido-final .cat-title,
#categoriaList details.cat-acc.liquido-final .cat-total {
  color: #111827;
}
/*até aqui*/

/* responsivo */
@media (max-width: 1100px) {
  .filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-action {
    grid-column: span 2;
  }

  .btn-search {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 780px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-right {
    width: 100%;
    justify-content: flex-end;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .filter-action {
    grid-column: auto;
  }

  .modern-table {
    display: block;
    overflow-x: auto;
  }

  .modal-info-grid {
    grid-template-columns: 1fr;
  }

  #modal {
    width: calc(100vw - 20px);
  }
}