/* v0.3.5-beta — tela de acesso/cadastro online */
body.auth-locked {
  overflow: hidden;
}
body.auth-locked .app-shell,
body.auth-locked .quick-rail,
body.auth-locked #toastContainer {
  display: none !important;
}
body.auth-ready #authScreen {
  display: none !important;
}
.auth-screen {
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 16% 18%, rgba(47, 111, 255, .16), transparent 32%),
    radial-gradient(circle at 86% 14%, rgba(0, 173, 255, .10), transparent 30%),
    linear-gradient(135deg, #eef4ff 0%, #f7faff 48%, #edf3fb 100%);
  color: #0f1f3a;
}
.auth-shell {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(420px, .78fr);
  gap: 22px;
  align-items: stretch;
}
.auth-brand-panel,
.auth-card {
  border: 1px solid rgba(31, 51, 92, .09);
  background: rgba(255,255,255,.86);
  box-shadow: 0 24px 70px rgba(13, 35, 75, .12);
  backdrop-filter: blur(18px);
}
.auth-brand-panel {
  min-height: 620px;
  border-radius: 28px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.auth-brand-panel::after {
  content: '';
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(37,105,244,.15), rgba(4,21,65,.04));
}
.auth-logo-card {
  width: 198px;
  min-height: 82px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(14, 41, 84, .11);
  margin-bottom: 30px;
}
.auth-logo-card img {
  max-width: 154px;
  max-height: 66px;
  object-fit: contain;
}
.auth-eyebrow {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #e7efff;
  color: #2865e8;
  font-size: 10px;
  letter-spacing: .1em;
  font-weight: 800;
  margin-bottom: 16px;
}
.auth-brand-panel h1 {
  max-width: 560px;
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -.045em;
  color: #0d1b35;
}
.auth-brand-panel p {
  max-width: 490px;
  margin: 16px 0 0;
  color: #687791;
  font-size: 12.5px;
  line-height: 1.65;
}
.auth-benefits {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin-top: 34px;
}
.auth-benefits span {
  display: grid;
  gap: 3px;
  padding: 13px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #edf1f7;
}
.auth-benefits strong {
  font-size: 12px;
  color: #10213d;
}
.auth-benefits small {
  font-size: 10.5px;
  color: #77859a;
}
.auth-card {
  border-radius: 28px;
  padding: 28px;
  align-self: center;
}
.auth-card-head {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
}
.auth-card-head strong {
  font-size: 19px;
  letter-spacing: -.02em;
  color: #0d1b35;
}
.auth-card-head small {
  color: #758399;
  font-size: 11px;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 14px;
  background: #eef3fb;
  margin-bottom: 18px;
}
.auth-tab {
  height: 36px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #6f7d93;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.auth-tab.active {
  background: #fff;
  color: #155ce2;
  box-shadow: 0 8px 18px rgba(20, 57, 117, .08);
}
.auth-form {
  display: grid;
  gap: 12px;
}
.auth-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.auth-card .field { gap: 5px; }
.auth-card label {
  font-size: 10.5px;
  color: #53627b;
  font-weight: 800;
}
.auth-input {
  min-height: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  font-size: 11.5px !important;
  padding: 0 12px !important;
  background: #fff !important;
}
.auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #637189 !important;
  font-size: 10.5px !important;
  line-height: 1.35;
}
.auth-check input { width: 14px; height: 14px; }
.auth-submit {
  width: 100%;
  min-height: 40px;
  border-radius: 13px;
  font-size: 11.5px !important;
  margin-top: 2px;
}
.auth-message {
  margin-top: 14px;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.35;
  background: #eef5ff;
  color: #155ce2;
  border: 1px solid #d9e8ff;
}
.auth-message.error {
  background: #fff1f1;
  color: #b42318;
  border-color: #ffd8d8;
}
.auth-message.success {
  background: #effaf3;
  color: #1f7a3d;
  border-color: #d8f0df;
}
.auth-footnote {
  margin-top: 14px;
  color: #8a96aa;
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}
.auth-logout-item strong { color: #b42318; }
.auth-logout-item .menu-item-icon { color: #b42318 !important; }
@media (max-width: 960px) {
  .auth-screen { padding: 18px; overflow-y: auto; place-items: start center; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: auto; padding: 24px; }
  .auth-brand-panel h1 { font-size: 24px; }
  .auth-card { padding: 22px; }
  .auth-benefits { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .auth-grid-two { grid-template-columns: 1fr; }
  .auth-logo-card { width: 170px; }
}

/* v0.3.6-beta — ADM cria usuários e controla módulos */
.auth-denied { display: none !important; }
.auth-admin-modal.hidden { display: none !important; }
.auth-admin-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-admin-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 18, 44, .44);
  backdrop-filter: blur(8px);
}
.auth-admin-panel {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  background: #fff;
  border: 1px solid rgba(18,32,58,.08);
  box-shadow: 0 26px 80px rgba(8, 24, 60, .26);
}
.auth-admin-head {
  padding: 22px 24px 18px;
  border-bottom: 1px solid #edf1f7;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.auth-admin-head h2 {
  margin: 6px 0 5px;
  font-size: 19px;
  letter-spacing: -.03em;
  color: #0e1f3c;
}
.auth-admin-head p {
  margin: 0;
  max-width: 620px;
  color: #758399;
  font-size: 11.5px;
  line-height: 1.45;
}
.auth-admin-close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid #e2e8f2;
  background: #fff;
  color: #23324f;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.auth-admin-grid {
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 20px;
  display: grid;
  grid-template-columns: minmax(260px, .76fr) minmax(0, 1.24fr);
  gap: 16px;
}
.auth-admin-list-card,
.auth-admin-form {
  border: 1px solid #e6ecf5;
  border-radius: 20px;
  background: #fbfdff;
  padding: 16px;
}
.auth-admin-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.auth-admin-section-title strong {
  color: #10213d;
  font-size: 13px;
}
.auth-admin-section-title small {
  color: #7a879b;
  font-size: 10.5px;
}
.auth-users-list {
  display: grid;
  gap: 8px;
}
.auth-user-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #edf1f7;
}
.auth-user-row.active {
  border-color: #cfe0ff;
  background: #f5f8ff;
}
.auth-user-row strong {
  display: block;
  font-size: 12px;
  color: #12203a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-user-row small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: #7c8798;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-user-row-actions {
  display: flex;
  gap: 6px;
}
.auth-permissions-head {
  margin-top: 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.auth-permissions-head strong {
  font-size: 12px;
  color: #10213d;
}
.auth-permissions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}
.auth-permission-group {
  border: 1px solid #edf1f7;
  border-radius: 16px;
  background: #fff;
  padding: 11px;
  display: grid;
  gap: 7px;
}
.auth-permission-group > strong {
  font-size: 11px;
  color: #65738a;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.auth-permission-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  color: #22304f;
  font-size: 11px;
  cursor: pointer;
}
.auth-permission-item input {
  width: 14px;
  height: 14px;
}
.auth-permission-item.admin-only span::after {
  content: ' ADM';
  margin-left: 5px;
  color: #1f5fe8;
  font-size: 9px;
  font-weight: 800;
}
.auth-admin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.auth-admin-form .auth-message {
  margin-top: 12px;
}
@media (max-width: 900px) {
  .auth-admin-grid { grid-template-columns: 1fr; }
  .auth-permissions-grid { grid-template-columns: 1fr; }
}


/* v0.5.4 — verificação de sessão sem piscar a tela de login */
body.auth-checking {
  overflow: hidden;
}
body.auth-checking .app-shell,
body.auth-checking .quick-rail,
body.auth-checking #toastContainer {
  display: none !important;
}
body.auth-checking #authLoginForm,
body.auth-checking .auth-footnote {
  display: none !important;
}
body.auth-checking .auth-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
body.auth-checking #authMessage {
  margin-top: 16px;
}
