:root {
  --bg: #e9eef1;
  --surface: #ffffff;
  --surface-soft: #f5f8fa;
  --surface-strong: #e1f1ee;
  --border: #d1dbe2;
  --border-strong: #aebdc7;
  --text: #0d2030;
  --muted: #5d6b78;
  --primary: #00586b;
  --primary-strong: #003d4c;
  --primary-soft: #dcefed;
  --accent: #8d9aa3;
  --success: #14744e;
  --row-hover: #eff8f6;
  --row-selected: #dcefed;
  --shadow: 0 16px 34px rgba(8, 29, 43, 0.09);
}

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

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
  overflow-x: hidden;
}

.navbar-brand {
  letter-spacing: 0;
}

.app-public {
  background: #0f1d21;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  align-items: center;
  gap: 42px;
  padding: 52px clamp(22px, 6vw, 84px);
  background:
    linear-gradient(90deg, rgba(7, 26, 29, 0.86), rgba(7, 26, 29, 0.52) 48%, rgba(7, 26, 29, 0.18)),
    url("/static/img/fundo_Inicial.jpg") center / cover no-repeat;
}

.public-content {
  min-height: 100vh;
}

.login-copy {
  min-width: 0;
  max-width: 620px;
  color: #fff;
}

.login-copy span,
.login-panel-header span {
  display: block;
  color: #83d0c3;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.login-copy h1 {
  margin: 8px 0 12px;
  color: #fff;
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 820;
  line-height: 1.02;
  max-width: 100%;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.login-copy p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  line-height: 1.45;
}

.login-title-tail {
  display: inline;
}

.login-panel {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
}

.login-panel-header {
  margin-bottom: 22px;
}

.login-panel-header span {
  color: var(--primary);
}

.login-panel-header h2 {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 28px;
  font-weight: 820;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-field {
  display: grid;
  gap: 6px;
}

.login-field label {
  color: #405461;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-field input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.login-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(17, 100, 102, 0.12);
}

.login-submit {
  width: 100%;
  min-height: 42px;
  margin-top: 4px;
}

.app-authenticated {
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(0, 61, 76, 0.08), rgba(141, 154, 163, 0.08)),
    var(--bg);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 54px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(90deg, #002d38, #00586b);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.menu-button {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 24px;
  line-height: 1;
}

.menu-button:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
}

.app-brand {
  min-width: 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 750;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-user {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-user-name {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.app-topbar .btn-outline-secondary {
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
}

.app-topbar .btn-outline-secondary:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.app-frame {
  min-height: 0;
  flex: 1;
  display: flex;
}

.app-sidebar {
  width: 208px;
  flex: 0 0 208px;
  background: #f7fafb;
  border-right: 1px solid var(--border);
  transition: width 0.18s ease, flex-basis 0.18s ease;
  overflow: hidden;
}

.sidebar-collapsed .app-sidebar {
  width: 0;
  flex-basis: 0;
}

.app-menu {
  padding: 14px 10px;
}

.app-menu-item {
  min-height: 38px;
  display: grid;
  align-content: center;
  gap: 1px;
  padding: 0 12px;
  border-radius: 8px;
  color: #314350;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.app-menu-item span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.app-menu-item strong {
  color: inherit;
  font-size: 13px;
  font-weight: 760;
}

.app-menu-item.active,
.app-menu-item:hover {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.app-content {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0) 180px),
    linear-gradient(135deg, rgba(0, 88, 107, 0.08), rgba(141, 154, 163, 0.1)),
    var(--bg);
}

.compact-alert {
  border-radius: 8px;
  font-size: 12px;
  margin: 0 22px 10px;
  padding: 8px 10px;
}

.rir-workspace {
  width: 100%;
  height: calc(100vh - 54px);
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px 22px 20px;
}

.rir-commandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.screen-heading {
  min-width: 0;
}

.screen-heading span {
  display: block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.screen-heading h1 {
  margin: 1px 0 0;
  color: var(--text);
  font-size: 23px;
  font-weight: 780;
  line-height: 1.15;
}

.command-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.command-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.command-button span {
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.command-button.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(17, 100, 102, 0.18);
}

.command-button.primary:hover {
  background: var(--primary-strong);
}

.command-button.secondary {
  background: var(--surface);
  border-color: var(--border);
  color: #344955;
}

.command-button.secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-soft);
}

.command-button.detail {
  background: #182230;
  color: #fff;
  box-shadow: 0 8px 18px rgba(24, 34, 48, 0.16);
}

.command-button.detail:not(.disabled):hover {
  transform: translateY(-1px);
}

.command-button.disabled {
  pointer-events: none;
  opacity: 0.45;
  box-shadow: none;
}

.rir-filterbar {
  display: grid;
  grid-template-columns: 160px 130px 250px minmax(250px, 1.1fr) minmax(230px, 1fr) 110px 110px 120px 120px;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.generic-filterbar {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.generic-filterbar .wide,
.generic-filterbar .description-field {
  grid-column: span 2;
}

.filter-field {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.filter-field label {
  margin: 0;
  color: #405461;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-field input,
.filter-field select {
  min-width: 0;
  width: 100%;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  line-height: 32px;
  padding: 0 10px;
  outline: none;
}

.filter-field input:focus,
.filter-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(17, 100, 102, 0.12);
}

.date-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.description-field {
  grid-column: span 3;
}

.rir-table-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.table-meta {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #f7f9fb);
}

.table-meta strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.table-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 1px;
}

.table-pages {
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-chip {
  min-width: 32px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: #344955;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.page-chip.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-chip.disabled {
  pointer-events: none;
  color: #98a2b3;
  background: #f2f4f7;
}

.rir-table-shell {
  min-height: 0;
  flex: 1;
  overflow: auto;
  background: var(--surface);
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.rir-grid-table {
  width: 100%;
  min-width: 1260px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  font-size: 12px;
}

.rir-grid-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 38px;
  padding: 0 9px;
  color: #344955;
  background: #f5f8fa;
  border-bottom: 1px solid var(--border-strong);
  font-size: 11px;
  font-weight: 850;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.rir-grid-table tbody td {
  height: 34px;
  padding: 0 9px;
  color: #1d2939;
  border-bottom: 1px solid #edf0f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
}

.rir-grid-table tbody tr {
  cursor: pointer;
}

.rir-grid-table tbody tr:hover td {
  background: var(--row-hover);
}

.rir-grid-table tbody tr.is-selected td {
  background: var(--row-selected);
  border-bottom-color: #badcd4;
}

.rir-grid-table tbody tr:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.select-column {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.row-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.row-marker {
  width: 16px;
  height: 16px;
  display: inline-block;
  border: 2px solid #b6c3cc;
  border-radius: 50%;
  background: #fff;
  vertical-align: middle;
}

.is-selected .row-marker {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 4px #fff;
  background: var(--primary);
}

.grid-sort-link {
  color: inherit;
  text-decoration: none;
}

.grid-sort-link:hover {
  color: var(--primary);
}

.grid-empty {
  height: 180px !important;
  text-align: center;
  color: var(--muted) !important;
}

.legacy-empty {
  text-align: center;
  color: var(--muted) !important;
  padding: 24px !important;
}

.detail-workspace {
  width: 100%;
  height: calc(100vh - 54px);
  overflow: auto;
  display: grid;
  grid-template-rows: auto auto minmax(0, auto);
  gap: 14px;
  padding: 18px 22px 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0) 180px),
    var(--bg);
}

.detail-header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.detail-main-card {
  max-height: 42vh;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow-y: auto;
}

.detail-section-heading {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid #bad8d1;
  background: linear-gradient(180deg, #e9f7f4, #dff3ef);
}

.detail-section-heading strong {
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.detail-group {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.detail-group:last-child {
  border-bottom: 0;
}

.detail-group h2 {
  margin: 0 0 12px;
  color: #344955;
  font-size: 13px;
  font-weight: 850;
}

.detail-field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.detail-field {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.detail-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-field strong {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-panels {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.analysis-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.analysis-panel-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #f7f9fb);
}

.analysis-panel-header span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.analysis-panel-header h2 {
  margin: 1px 0 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 820;
}

.analysis-panel-header strong {
  min-width: 38px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 850;
}

.analysis-table-wrap {
  max-height: 360px;
  overflow: auto;
}

.analysis-table {
  min-width: 640px;
}

.operational-detail-card {
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.operational-detail-panels {
  min-height: 0;
  grid-template-columns: 1fr;
}

.operational-table-wrap {
  flex: 1;
  max-height: none;
  min-height: 0;
}

.operational-detail-table {
  min-width: 1180px;
}

.operational-detail-workspace {
  grid-template-rows: auto minmax(140px, 0.75fr) minmax(300px, 1.45fr);
  gap: 10px;
  overflow: hidden;
  padding: 12px 16px 14px;
}

.operational-list-workspace {
  gap: 10px;
  padding: 14px 18px 16px;
}

.operational-list-workspace .rir-filterbar {
  padding: 12px;
}

.operational-list-workspace .rir-grid-table thead th {
  height: 40px;
}

.operational-list-workspace .rir-grid-table tbody td {
  height: 38px;
  font-size: 12.5px;
}

.operational-detail-workspace .detail-header {
  min-height: 34px;
}

.operational-detail-workspace .screen-heading span {
  font-size: 11px;
}

.operational-detail-workspace .screen-heading h1 {
  font-size: 20px;
}

.operational-detail-workspace .detail-section-heading {
  min-height: 34px;
  padding: 0 12px;
}

.operational-detail-workspace .detail-group {
  padding: 8px 12px;
}

.operational-detail-workspace .detail-group h2 {
  margin-bottom: 6px;
  font-size: 12px;
}

.operational-detail-workspace .detail-field-grid {
  gap: 6px;
}

.operational-detail-workspace .detail-field {
  gap: 2px;
}

.operational-detail-workspace .detail-field span {
  font-size: 10px;
}

.operational-detail-workspace .detail-field strong {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 12px;
}

.operational-detail-workspace .analysis-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.operational-detail-workspace .analysis-panel-header {
  min-height: 42px;
  padding: 7px 12px;
}

.operational-detail-workspace .analysis-panel-header h2 {
  font-size: 15px;
}

.operational-detail-workspace .analysis-panel-header strong {
  min-width: 34px;
  height: 26px;
  font-size: 12px;
}

.analysis-table th:first-child,
.analysis-table td:first-child {
  width: 76px;
  text-align: right;
}

.detail-empty {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.module-home {
  width: 100%;
  min-height: calc(100vh - 54px);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 22px;
}

.module-home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.module-card {
  position: relative;
  min-height: 172px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  align-content: start;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 251, 0.96)),
    var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(8, 29, 43, 0.08);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.module-card:hover,
.module-card:focus-visible {
  border-color: var(--module-color);
  color: var(--text);
  box-shadow: 0 18px 32px rgba(8, 29, 43, 0.13);
  transform: translateY(-2px);
}

.module-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--module-color) 26%, transparent);
  outline-offset: 2px;
}

.module-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--module-color) 13%, #ffffff);
  color: var(--module-color);
}

.module-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.2;
}

.module-area {
  width: fit-content;
  max-width: 100%;
  margin-top: 5px;
  color: var(--module-color);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.module-card strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 830;
  line-height: 1.12;
}

.module-description {
  max-width: 30ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.module-open {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #667788;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.module-card:hover .module-open,
.module-card:focus-visible .module-open {
  border-color: var(--module-color);
  background: var(--module-color);
  color: #fff;
}

.module-open svg {
  width: 18px;
  height: 18px;
}

.tone-teal {
  --module-color: #007f78;
}

.tone-green {
  --module-color: #267a3f;
}

.tone-blue {
  --module-color: #2268a7;
}

.tone-amber {
  --module-color: #b26016;
}

.tone-red {
  --module-color: #b7473f;
}

.tone-violet {
  --module-color: #7655b8;
}

.admin-workspace,
.empty-workspace {
  width: 100%;
  min-height: calc(100vh - 54px);
  overflow: auto;
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px 22px 22px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 14px;
}

.admin-card,
.empty-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-card {
  overflow: hidden;
}

.admin-card-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #f7f9fb);
}

.admin-card-header span,
.empty-card span {
  display: block;
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-card-header h2,
.empty-card h1 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 820;
}

.admin-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.module-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.module-list legend {
  margin: 0 0 2px;
  color: #405461;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.module-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
}

.module-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.module-check strong {
  display: block;
  color: var(--primary);
  font-size: 11px;
  text-transform: uppercase;
}

.module-check.compact {
  min-height: 32px;
  padding: 6px 8px;
  background: #fff;
}

.users-list {
  display: grid;
}

.user-permission-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(260px, 1.4fr) minmax(160px, 0.8fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.user-permission-row:last-child {
  border-bottom: 0;
}

.user-summary {
  min-width: 0;
}

.user-summary strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-summary span {
  color: var(--muted);
  font-size: 12px;
}

.user-modules {
  display: grid;
  gap: 6px;
}

.user-password input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
}

.empty-card {
  max-width: 520px;
  padding: 22px;
}

.empty-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

@media (max-width: 1360px) {
  .rir-filterbar {
    grid-template-columns: 170px 140px 240px minmax(250px, 1fr) minmax(250px, 1fr);
  }

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

  .description-field {
    grid-column: span 2;
  }
}

@media (max-width: 980px) {
  .app-shell {
    min-height: 100dvh;
  }

  .app-authenticated {
    overflow: auto;
  }

  .app-content {
    overflow: visible;
  }

  .rir-workspace,
  .detail-workspace {
    height: auto;
    min-height: calc(100dvh - 54px);
  }

  .rir-commandbar,
  .table-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .command-actions {
    justify-content: flex-start;
  }

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

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

  .description-field {
    grid-column: span 2;
  }

  .rir-table-shell {
    min-height: 52vh;
  }

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

  .analysis-panels {
    grid-template-columns: 1fr;
  }

  .module-home {
    min-height: calc(100dvh - 54px);
  }

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

  .operational-detail-workspace {
    grid-template-rows: auto auto auto;
    overflow: visible;
  }

  .operational-detail-card,
  .detail-main-card {
    max-height: none;
  }

  .operational-table-wrap {
    max-height: min(68vh, 560px);
  }

  .admin-grid,
  .user-permission-row {
    grid-template-columns: 1fr;
  }

  .login-shell {
    min-height: 100dvh;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: end;
  }

  .login-copy {
    max-width: 720px;
  }
}

@media (max-width: 720px) {
  .app-topbar {
    height: 52px;
    gap: 8px;
    padding: 0 10px;
  }

  .menu-button {
    width: 38px;
    height: 38px;
  }

  .app-brand {
    font-size: 15px;
  }

  .app-user {
    gap: 8px;
  }

  .app-frame {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    top: 52px;
    bottom: 0;
    left: 0;
    z-index: 40;
    width: min(84vw, 300px);
    flex-basis: auto;
    border-right: 0;
    border-bottom: 0;
    box-shadow: 18px 0 34px rgba(8, 29, 43, 0.2);
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
  }

  .sidebar-collapsed .app-sidebar {
    display: block;
    transform: translateX(0);
  }

  .sidebar-collapsed .app-frame::before {
    content: "";
    position: fixed;
    inset: 52px 0 0;
    z-index: 35;
    background: rgba(3, 18, 24, 0.28);
  }

  .app-menu {
    padding: 12px;
  }

  .app-menu-item {
    min-height: 46px;
  }

  .rir-workspace,
  .detail-workspace,
  .module-home,
  .admin-workspace,
  .empty-workspace {
    padding: 10px;
  }

  .rir-workspace,
  .detail-workspace {
    min-height: calc(100dvh - 52px);
    grid-template-rows: auto auto auto;
    gap: 10px;
  }

  .rir-commandbar,
  .detail-header {
    gap: 10px;
  }

  .screen-heading span {
    font-size: 11px;
  }

  .screen-heading h1 {
    font-size: 20px;
  }

  .command-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-button {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
  }

  .detail-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-header .command-button {
    width: auto;
  }

  .rir-filterbar,
  .detail-field-grid {
    grid-template-columns: 1fr;
  }

  .rir-filterbar {
    gap: 8px;
    padding: 10px;
    box-shadow: none;
  }

  .filter-field input,
  .filter-field select {
    height: 40px;
    font-size: 16px;
    line-height: 38px;
  }

  .date-range {
    grid-template-columns: 1fr;
  }

  .description-field {
    grid-column: auto;
  }

  .generic-filterbar .wide,
  .generic-filterbar .description-field {
    grid-column: auto;
  }

  .app-user-name {
    display: none;
  }

  .table-meta {
    min-height: auto;
    padding: 10px;
  }

  .table-pages {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .page-chip {
    width: 100%;
    height: 36px;
  }

  .rir-table-shell {
    min-height: 56vh;
  }

  .rir-grid-table {
    min-width: 980px;
  }

  .operational-list-workspace .rir-grid-table {
    min-width: 1020px;
  }

  .operational-detail-workspace {
    overflow: visible;
  }

  .operational-table-wrap {
    max-height: none;
    min-height: 50vh;
  }

  .analysis-panel-header {
    min-height: auto;
    align-items: flex-start;
  }

  .module-home {
    min-height: calc(100dvh - 52px);
    gap: 12px;
  }

  .module-home-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .module-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .module-card {
    min-height: 138px;
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 12px;
    padding: 14px;
  }

  .module-icon {
    grid-row: 1 / span 3;
    width: 48px;
    height: 48px;
  }

  .module-area {
    margin-top: 0;
  }

  .module-card strong,
  .module-description {
    grid-column: 2;
  }

  .module-open {
    right: 10px;
    top: 10px;
  }

  .login-shell {
    min-height: 100dvh;
    align-content: center;
    gap: 18px;
    padding: 22px 16px;
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
    background:
      linear-gradient(180deg, rgba(7, 26, 29, 0.78), rgba(7, 26, 29, 0.58)),
      url("/static/img/fundo_Inicial.jpg") center / cover no-repeat;
  }

  .login-copy,
  .login-panel {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  .login-copy span,
  .login-panel-header span {
    font-size: 11px;
  }

  .login-copy h1 {
    font-size: 28px;
    line-height: 1.08;
  }

  .login-title-tail {
    display: block;
  }

  .login-copy p {
    font-size: 14px;
  }

  .login-panel {
    padding: 18px;
  }

  .login-panel-header h2 {
    font-size: 24px;
  }

  .login-field input {
    height: 44px;
    font-size: 16px;
  }

  .detail-main-card {
    max-height: none;
  }
}

@media (max-width: 420px) {
  .app-brand {
    font-size: 14px;
  }

  .command-actions {
    grid-template-columns: 1fr;
  }

  .login-shell {
    gap: 14px;
    padding: 18px 12px;
  }

  .login-copy,
  .login-panel {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  .login-copy h1 {
    font-size: 26px;
  }
}
