:root {
  color-scheme: light;
  --navy-950: #00172d;
  --navy-900: #012243;
  --navy-800: #052f5d;
  --blue-700: #004eea;
  --blue-600: #075cff;
  --blue-100: #eaf1ff;
  --ink-900: #061638;
  --ink-700: #203764;
  --ink-500: #64739b;
  --line: #dbe4f3;
  --surface: #ffffff;
  --surface-soft: #f5f8fd;
  --green: #16a34a;
  --red: #dc2626;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink-900);
  background: var(--surface-soft);
}

a {
  color: var(--blue-700);
  text-decoration: none;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(320px, 480px) minmax(0, 1fr);
  min-height: 100vh;
}

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 38px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(138deg, rgba(0, 78, 234, .18), rgba(0, 23, 45, 0) 46%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .8), transparent);
  pointer-events: none;
}

.brand-top,
.brand-copy,
.brand-status {
  position: relative;
  z-index: 1;
}

.brand-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-top.compact {
  padding: 26px 22px 22px;
}

.brand-mark {
  position: relative;
  width: 44px;
  height: 42px;
}

.brand-mark span {
  position: absolute;
  top: 5px;
  width: 15px;
  height: 32px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #33a6ff, #0050f5);
  transform: skewY(-28deg);
}

.brand-mark span:first-child {
  left: 5px;
}

.brand-mark span:last-child {
  right: 5px;
  background: linear-gradient(180deg, #78c4ff, #0665ff);
}

.brand-name {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 25px;
  letter-spacing: 0;
}

.brand-name strong {
  font-weight: 800;
}

.brand-name span {
  color: #1785ff;
  font-weight: 500;
}

.brand-copy {
  max-width: 360px;
}

.eyebrow,
.breadcrumb,
.app-header p,
.module-card span {
  margin: 0;
  color: var(--blue-600);
  font-size: 13px;
  font-weight: 700;
}

.brand-copy .eyebrow {
  color: #7bbcff;
}

.brand-copy h1 {
  margin: 14px 0 14px;
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: 0;
}

.brand-copy p:last-child {
  margin: 0;
  color: #c7d7ef;
  font-size: 16px;
  line-height: 1.6;
}

.brand-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.brand-status div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
}

.brand-status span,
.brand-status strong {
  display: block;
}

.brand-status span {
  color: #a8bbd7;
  font-size: 12px;
}

.brand-status strong {
  margin-top: 6px;
  font-size: 15px;
}

.login-panel {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(245, 248, 253, .94)),
    var(--surface-soft);
}

.login-card {
  width: min(100%, 480px);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(4, 22, 56, .10);
}

.login-header h2 {
  margin: 8px 0 8px;
  font-size: 30px;
  letter-spacing: 0;
}

.login-header p:last-child {
  margin: 0 0 30px;
  color: var(--ink-500);
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form > label {
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 700;
}

.field {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.field:focus-within {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(7, 92, 255, .10);
}

.field input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  padding: 0 14px;
  color: var(--ink-900);
  font: inherit;
  background: transparent;
}

.field input::placeholder {
  color: #8a98bb;
}

.password-field button {
  flex: 0 0 auto;
  margin-right: 6px;
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--blue-700);
  background: var(--blue-100);
  font-weight: 700;
  cursor: pointer;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 6px;
  color: var(--ink-500);
  font-size: 13px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue-600);
}

/* Padrao global para caixas de selecao. Algumas telas possuem regras genericas como input
   { width:100%; min-height:42px }, que acabavam transformando o checkbox em um quadrado enorme.
   A especificidade por tipo, com dimensoes fixas, preserva todos os formularios sem exigir uma
   correcao diferente em cada modulo. */
input[type="checkbox"] {
  box-sizing: border-box;
  width: 17px !important;
  min-width: 17px !important;
  max-width: 17px !important;
  height: 17px !important;
  min-height: 17px !important;
  max-height: 17px !important;
  flex: 0 0 17px;
  margin: 0;
  padding: 0 !important;
  border-radius: 4px;
  accent-color: var(--blue-600, #075cff);
  vertical-align: middle;
  cursor: pointer;
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--blue-600, #075cff) 34%, transparent);
  outline-offset: 2px;
}

input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.message {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.message.success {
  color: var(--green);
}

.primary-button,
.secondary-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  color: #fff;
  background: var(--blue-700);
  box-shadow: 0 14px 28px color-mix(in srgb, var(--blue-700) 26%, transparent);
}

.secondary-button {
  color: var(--ink-900);
  border: 1px solid var(--line);
  background: var(--surface);
}

.request-access-link {
  display: block;
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-700, #004eea);
}

.request-access-link:hover {
  text-decoration: underline;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--surface-soft);
}

.app-sidebar {
  min-height: 100vh;
  color: #fff;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950));
}

.app-nav {
  display: grid;
  gap: 7px;
  padding: 8px 14px;
}

.app-nav a {
  border-radius: 8px;
  padding: 13px 15px;
  color: #dbe8ff;
  font-weight: 700;
}

.app-nav a.active,
.app-nav a:hover {
  color: #fff;
  background: var(--blue-700);
}

.app-content {
  padding: 28px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.app-header h1 {
  margin: 5px 0 0;
  font-size: 28px;
  letter-spacing: 0;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

.module-card {
  min-height: 120px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(4, 22, 56, .07);
}

.module-card strong {
  display: block;
  margin-top: 12px;
  color: var(--ink-900);
  font-size: 20px;
}



.settings-panel {
  display: grid;
  gap: 16px;
}

.settings-card {
  max-width: 860px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(4, 22, 56, .07);
}

.settings-card > span {
  color: var(--blue-600);
  font-size: 13px;
  font-weight: 800;
}

.settings-card h2 {
  margin: 8px 0 10px;
}

.settings-card p {
  line-height: 1.55;
}

.settings-warning {
  margin: 16px 0;
  padding: 12px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
}

.settings-result {
  min-height: 90px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #bfdbfe;
  white-space: pre-wrap;
}

.disabled-button {
  opacity: .55;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .login-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: auto;
    gap: 54px;
  }

  .brand-copy h1 {
    font-size: 34px;
  }

  .app-sidebar {
    min-height: auto;
  }

  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .brand-panel,
  .login-panel,
  .app-content {
    padding: 18px;
  }

  .login-card {
    padding: 22px;
  }

  .form-row,
  .app-header {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-status,
  .module-grid {
    grid-template-columns: 1fr;
  }
}

/* Painel visual para desenvolvimento local.
   Aparece somente para usuario administrativo quando o modo DEBUG SELECT estiver disponivel. */
.debug-select-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  width: min(420px, calc(100vw - 32px));
  max-height: 55vh;
  overflow: auto;
  padding: 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.96);
  color: #e5e7eb;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  font-size: 12px;
}

.debug-select-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.debug-select-header button,
.debug-select-clear {
  border: 0;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.debug-select-list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.debug-select-list article {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.debug-select-list code {
  white-space: pre-wrap;
  color: #bfdbfe;
}
