:root {
  --ea-topbar-height: 100px;
  --ea-navy: #0b2a4a;
  --ea-blue: #2f80ed;
  --ea-blue-mid: #1f5faf;
  --ea-gray: #bfc5cc;
  --ea-white: #ffffff;
  --ea-bg: #f4f7fb;
  --ea-text: #172033;
  --ea-muted: #6c7890;
  --ea-border: #e6ebf2;
  --ea-shadow: 0 18px 45px rgba(11, 42, 74, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ea-text);
  background: var(--ea-bg);
}

a {
  text-decoration: none;
}

.btn {
  border-radius: 12px;
  font-weight: 700;
  padding: 0.65rem 1rem;
}

.btn-primary {
  --bs-btn-bg: var(--ea-blue);
  --bs-btn-border-color: var(--ea-blue);
  --bs-btn-hover-bg: var(--ea-blue-mid);
  --bs-btn-hover-border-color: var(--ea-blue-mid);
  box-shadow: 0 10px 24px rgba(47, 128, 237, 0.28);
}

.btn-secondary {
  --bs-btn-bg: var(--ea-navy);
  --bs-btn-border-color: var(--ea-navy);
  --bs-btn-hover-bg: var(--ea-blue-mid);
  --bs-btn-hover-border-color: var(--ea-blue-mid);
}

.btn-outline-primary {
  --bs-btn-color: var(--ea-blue);
  --bs-btn-border-color: rgba(47, 128, 237, 0.35);
  --bs-btn-hover-bg: var(--ea-blue);
  --bs-btn-hover-border-color: var(--ea-blue);
}

.form-control,
.form-select,
.input-group-text {
  border-color: var(--ea-border);
  border-radius: 12px;
  min-height: 46px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--ea-blue);
  box-shadow: 0 0 0 0.2rem rgba(47, 128, 237, 0.14);
}

.input-group-modern .input-group-text {
  background: #f8fbff;
  color: var(--ea-blue);
}

.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(47, 128, 237, 0.25), transparent 34rem),
    linear-gradient(135deg, var(--ea-navy), #06182d 58%, #123d6a);
}

.auth-wrapper {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  align-items: center;
  gap: 42px;
  padding: 42px 0;
}

.auth-brand-panel {
  color: var(--ea-white);
}

.brand-pill {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  margin-bottom: 28px;
  font-weight: 700;
}

.logo-card {
  width: min(460px, 100%);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ea-white);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--ea-shadow);
  margin-bottom: 30px;
}

.logo-card img,
.auth-logo {
  max-width: 100%;
  height: auto;
}

.logo-card img {
  max-height: 250px;
  width: auto;
}

.auth-brand-panel h1 {
  font-size: clamp(2.25rem, 6vw, 4.8rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.06em;
  max-width: 720px;
}

.auth-brand-panel p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.12rem;
  max-width: 620px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 30px;
  padding: clamp(26px, 5vw, 44px);
  box-shadow: var(--ea-shadow);
}

.auth-card h2 {
  font-weight: 800;
  color: var(--ea-navy);
}

.auth-logo {
  max-height: 220px;
  margin-bottom: 18px;
}

.container-scroller {
  min-height: 100vh;
}

.default-layout-navbar {
  height: var(--ea-topbar-height);
  min-height: var(--ea-topbar-height);
  max-height: var(--ea-topbar-height);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  background: var(--ea-white);
  border-bottom: 1px solid var(--ea-border);
  box-shadow: 0 8px 24px rgba(11, 42, 74, 0.05);
  z-index: 1030;
}

.navbar-brand-wrapper {
  width: 320px;
  align-self: stretch;
  border-right: 1px solid var(--ea-border);
  padding: 0 10px;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* Bootstrap .navbar-brand traz padding vertical — zera para a logo subir na barra */
.default-layout-navbar .navbar-brand.brand-logo {
  margin: 0;
  padding: 0;
  line-height: 0;
}

.brand-logo {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 4px 0 0;
  color: var(--ea-navy);
  font-weight: 800;
}

.brand-logo img {
  max-height: calc(var(--ea-topbar-height) - 18px);
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: top center;
  display: block;
  transform: translateY(-14px) scale(2);
  transform-origin: top center;
}

.navbar-menu-wrapper {
  flex: 1;
  align-self: stretch;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  min-width: 0;
}

.navbar-toggler {
  border: 0;
  background: #edf4ff;
  color: var(--ea-navy);
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.navbar-profile {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.profile-name {
  font-weight: 800;
  color: var(--ea-navy);
}

.profile-link {
  display: grid;
  color: inherit;
}

.profile-role {
  color: var(--ea-muted);
  font-size: 0.85rem;
}

.page-body-wrapper {
  display: flex;
  padding-top: var(--ea-topbar-height);
}

.sidebar {
  width: 270px;
  min-height: calc(100vh - var(--ea-topbar-height));
  background: var(--ea-navy);
  color: var(--ea-white);
  position: fixed;
  top: var(--ea-topbar-height);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  transition: transform 0.25s ease;
  z-index: 1020;
}

.sidebar .nav {
  display: block;
  padding: 18px 14px 30px;
}

.nav-item {
  margin-bottom: 7px;
}

.nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
  text-align: left;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--ea-white);
  background: rgba(47, 128, 237, 0.22);
}

.menu-icon {
  font-size: 1.25rem;
  color: #8fc0ff;
}

.nav-profile .nav-link {
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--ea-blue);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.nav-profile span,
.nav-profile strong {
  display: block;
}

.nav-profile span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.84rem;
}

.nav-section {
  color: #8fc0ff;
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 24px 14px 10px;
}

.submenu {
  display: none;
  padding: 4px 0 8px 46px;
}

.has-submenu.open .submenu {
  display: grid;
  gap: 6px;
}

.submenu-link {
  color: rgba(255, 255, 255, 0.66);
  background: transparent;
  border: 0;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 5px 0;
  text-align: left;
  display: block;
}

.main-panel {
  width: calc(100% - 270px);
  margin-left: 270px;
  min-height: calc(100vh - var(--ea-topbar-height));
}

.content-wrapper {
  padding: 30px;
}

.hero-card,
.module-card,
.card,
.empty-state,
.config-card {
  border: 1px solid var(--ea-border);
  border-radius: 24px;
  background: var(--ea-white);
  box-shadow: 0 12px 32px rgba(11, 42, 74, 0.06);
}

.hero-card {
  min-height: 220px;
  padding: clamp(26px, 4vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background:
    linear-gradient(135deg, rgba(11, 42, 74, 0.98), rgba(31, 95, 175, 0.92)),
    var(--ea-navy);
  color: var(--ea-white);
  overflow: hidden;
  position: relative;
}

.hero-eyebrow {
  color: #9bc8ff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
}

.hero-card h1 {
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 12px 0 6px;
  font-size: clamp(2rem, 5vw, 3.8rem);
}

.hero-card p {
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
}

.hero-icon {
  width: 110px;
  height: 110px;
  border-radius: 32px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  font-size: 4rem;
}

.module-card {
  height: 100%;
  padding: 28px;
}

.module-card--with-dev-flag {
  position: relative;
  overflow: hidden;
}

/* Faixa discreta no canto superior direito — módulo em desenvolvimento */
.module-card__dev-flag {
  position: absolute;
  top: 0;
  right: 0;
  max-width: 52%;
  background: linear-gradient(135deg, #b71c1c 0%, #c62828 45%, #d32f2f 100%);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 6px 10px 6px 16px;
  border-bottom-left-radius: 12px;
  box-shadow: -2px 3px 10px rgba(183, 28, 28, 0.28);
}

.module-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #edf4ff;
  color: var(--ea-blue);
  font-size: 1.75rem;
  margin-bottom: 18px;
}

.module-card h3 {
  color: var(--ea-navy);
  font-weight: 800;
  font-size: 1.25rem;
}

.module-card p {
  color: var(--ea-muted);
  min-height: 48px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.page-header h1 {
  font-weight: 800;
  color: var(--ea-navy);
  margin: 0;
}

.page-header p {
  color: var(--ea-muted);
  margin: 4px 0 0;
}

.btn-verdict-wide {
  min-width: 168px;
  justify-content: center;
}

.btn-download-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ea-blue);
}

.btn-download-icon i {
  font-size: 1.25rem;
}

.table-card .table > :not(caption) > * > * {
  padding: 1rem;
}

.status-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  background: #edf4ff;
  color: var(--ea-blue-mid);
}

.status-cadastrado {
  background: #fff2df;
  color: #b76800;
}

.status-analisada {
  background: #edf4ff;
  color: var(--ea-blue-mid);
}

.status-inativo,
.status-bloqueado {
  background: #fff1f1;
  color: #bf3030;
}

.status-bloqueado-por-tentativa {
  background: #fff7df;
  color: #a36a00;
}

.form-card .card-footer {
  background: #f8fbff;
  border-top: 1px solid var(--ea-border);
  border-radius: 0 0 24px 24px;
}

.permission-list {
  display: grid;
  gap: 12px;
}

.permission-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--ea-border);
  border-radius: 16px;
  padding: 16px;
}

.permission-row strong,
.permission-row small {
  display: block;
}

.permission-row small {
  color: var(--ea-muted);
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--ea-muted);
}

.empty-state i {
  font-size: 3.2rem;
  color: var(--ea-blue);
}

.config-card {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 24px;
  color: var(--ea-text);
  height: 100%;
}

.config-card i {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--ea-navy);
  color: var(--ea-white);
  font-size: 1.7rem;
}

.config-card strong,
.config-card small {
  display: block;
}

.config-card small {
  color: var(--ea-muted);
}

.log-list {
  display: grid;
  gap: 12px;
}

.log-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--ea-white);
  border: 1px solid var(--ea-border);
  border-radius: 18px;
}

.log-item strong,
.log-item span,
.log-item small {
  display: block;
}

.log-item span {
  color: var(--ea-text);
}

.log-item small {
  color: var(--ea-muted);
}

.detail-list dt {
  color: var(--ea-navy);
}

.filter-box {
  border: 1px solid var(--ea-border);
  border-radius: 16px;
  padding: 16px;
  background: #f8fbff;
  height: 100%;
}

.filter-options {
  max-height: 190px;
  overflow: auto;
  display: grid;
  gap: 4px;
}

.filter-select-list {
  overflow: auto;
  accent-color: var(--ea-blue);
}

.filter-select-single {
  min-height: 46px;
}

.filter-select-single:focus {
  border-color: var(--ea-blue);
  box-shadow: 0 0 0 0.2rem rgba(47, 128, 237, 0.14);
}

.ars-col-id {
  min-width: 82px;
  width: 82px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ars-col-title {
  max-width: 520px;
  white-space: normal;
}

.analysis-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(11, 42, 74, 0.84);
  color: var(--ea-white);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}

.analysis-loader {
  width: 84px;
  height: 84px;
  border: 8px solid rgba(255, 255, 255, 0.28);
  border-top-color: var(--ea-white);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 18px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.metric-card {
  background: var(--ea-white);
  border: 1px solid var(--ea-border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 12px 32px rgba(11, 42, 74, 0.06);
}

.metric-card span {
  display: block;
  color: var(--ea-muted);
  font-weight: 700;
  margin-bottom: 12px;
}

.metric-card strong {
  display: block;
  color: var(--ea-navy);
  font-size: 2rem;
  line-height: 1.1;
}

.total-gloss {
  display: inline-flex;
  padding: 16px 22px;
  border-radius: 18px;
  background: var(--ea-navy);
  color: var(--ea-white);
  font-size: 1.35rem;
  font-weight: 800;
}

.total-gloss-discreet {
  background: #1f5faf;
  font-size: 1rem;
  font-weight: 700;
  opacity: 0.92;
}

.verdict-separator {
  margin: 20px 0;
  border-color: var(--ea-border);
  opacity: 1;
}

.verdict-gloss-breakdown {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.verdict-gloss-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--ea-border);
  border-radius: 16px;
  background: #f8fbff;
  color: var(--ea-navy);
}

.verdict-gloss-item span {
  font-weight: 700;
}

.verdict-gloss-item strong {
  color: var(--ea-blue-mid);
  font-size: 1.08rem;
}

.verdict-gloss-item-ceiling {
  border-color: rgba(31, 95, 175, 0.32);
  background: #eef6ff;
}

.gloss-inline {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(218, 30, 40, 0.1);
  color: #b4232a;
  font-weight: 800;
}

.verdict-table {
  min-width: 980px;
}

.verdict-group-row td {
  background: #f4f9ff;
  color: var(--ea-navy);
  border-top: 1px solid var(--ea-border);
  border-bottom: 1px solid var(--ea-border);
}

/* Botões na tabela herdavam estilos do tema/Bootstrap; usar BEM + reset explícito para manter verde/vermelho. */
button.verdict-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  margin: 0;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.24);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
}

button.verdict-icon i,
button.verdict-icon i::before {
  color: inherit !important;
}

button.verdict-icon:hover {
  transform: translateY(-1px) scale(1.03);
}

button.verdict-icon.verdict-icon--ok {
  background: linear-gradient(145deg, #42d86f, #168b3b) !important;
  background-color: #168b3b !important;
  box-shadow:
    inset 0 2px 7px rgba(255, 255, 255, 0.45),
    inset 0 -4px 9px rgba(0, 0, 0, 0.18),
    0 10px 22px rgba(36, 161, 72, 0.28) !important;
}

button.verdict-icon.verdict-icon--bad {
  background: linear-gradient(145deg, #ff6b73, #da1e28) !important;
  background-color: #da1e28 !important;
  box-shadow:
    inset 0 2px 7px rgba(255, 255, 255, 0.42),
    inset 0 -4px 9px rgba(0, 0, 0, 0.2),
    0 10px 22px rgba(218, 30, 40, 0.28) !important;
}

.verdict-detail-modal {
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(11, 42, 74, 0.24);
}

.verdict-detail-modal .modal-header {
  background: var(--ea-navy);
  color: var(--ea-white);
}

.verdict-detail-modal .btn-close {
  filter: invert(1) grayscale(100%);
  opacity: 0.85;
}

.verdict-detail-modal__text {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: #f8fbff;
  color: var(--ea-text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.96rem;
  line-height: 1.55;
}

@media (max-width: 991.98px) {
  .auth-wrapper {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    text-align: center;
  }

  .logo-card {
    margin-left: auto;
    margin-right: auto;
  }

  .navbar-brand-wrapper {
    width: 170px;
  }

  .navbar-toggler {
    display: inline-flex;
  }

  .navbar-menu-wrapper {
    padding-left: 58px;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .main-panel {
    width: 100%;
    margin-left: 0;
  }

  .content-wrapper {
    padding: 22px;
  }
}

@media (max-width: 767.98px) {
  .brand-logo img {
    max-height: calc(var(--ea-topbar-height) - 12px);
  }

  .navbar-brand-wrapper {
    width: 80px;
    padding: 0 8px;
  }

  .navbar-menu-wrapper {
    padding: 0 12px 0 54px;
  }

  .profile-role {
    display: none;
  }

  .page-header,
  .hero-card,
  .permission-row,
  .log-item {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-icon {
    width: 76px;
    height: 76px;
    font-size: 2.4rem;
  }

  .action-buttons {
    display: grid;
    gap: 6px;
  }
}

html.global-page-loader-active,
html.global-page-loader-active body {
  overflow: hidden;
}

.global-page-loader {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.38s ease, visibility 0.38s ease;
}

.global-page-loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
  padding: 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 28px 64px rgba(11, 42, 74, 0.12), 0 0 0 1px rgba(47, 128, 237, 0.12);
}

.global-page-loader__logo {
  max-width: min(280px, 72vw);
  height: auto;
  object-fit: contain;
  display: block;
  animation: global-page-loader-pulse 1.45s ease-in-out infinite;
  filter: drop-shadow(0 12px 28px rgba(11, 42, 74, 0.18));
}

@keyframes global-page-loader-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  45% {
    transform: scale(1.065);
    opacity: 0.92;
  }
}

.global-page-loader__text {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ea-navy);
  letter-spacing: 0.02em;
}

.global-page-loader.global-page-loader--fadeout {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.global-page-loader[hidden] {
  display: none !important;
}

body.auth-page .global-page-loader {
  background: radial-gradient(circle at 50% 30%, rgba(47, 128, 237, 0.12), transparent 55%), rgba(255, 255, 255, 0.94);
}

/* OpenSheetMusicDisplay: notação gravada (MusicXML) */
.score-osmd-shell {
  overflow-x: auto;
}

.score-osmd-shell svg {
  display: block;
  max-width: 100%;
  height: auto;
}
