/* Modal de Login */
  #authOverlay {
    position: fixed; inset: 0; z-index: 99999;
    background: linear-gradient(135deg, #0a0a2e 0%, #072d91 60%, #00d4ff 100%);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Segoe UI', sans-serif;
  }
  #authCard {
    background: #fff; border-radius: 20px;
    padding: 40px 36px 32px; width: 360px; max-width: 94vw;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    text-align: center;
  }
  #authCard .auth-logo {
    font-size: 28px; font-weight: 900; color: #072d91; margin-bottom: 4px;
    letter-spacing: -0.5px;
  }
  #authCard .auth-logo span { color: #00aacc; }
  #authCard .auth-subtitle {
    font-size: 13px; color: #777; margin-bottom: 28px;
  }
  #authCard label {
    display: block; text-align: left; font-size: 12px;
    font-weight: 700; color: #444; text-transform: uppercase;
    letter-spacing: 0.4px; margin-bottom: 5px;
  }
  #authCard input {
    width: 100%; padding: 11px 14px; border: 1.5px solid #d0d7e2;
    border-radius: 9px; font-size: 15px; margin-bottom: 16px;
    outline: none; transition: border 0.2s;
    box-sizing: border-box;
  }
  #authCard input:focus { border-color: #072d91; box-shadow: 0 0 0 3px rgba(7,45,145,0.10); }
  #authBtn {
    width: 100%; padding: 13px; background: linear-gradient(90deg,#072d91,#00d4ff);
    color: #fff; border: none; border-radius: 10px; font-size: 16px;
    font-weight: 700; cursor: pointer; margin-top: 4px;
    transition: opacity 0.2s, transform 0.15s;
  }
  #authBtn:hover { opacity: 0.9; transform: translateY(-1px); }
  #authError {
    background: #fef2f2; color: #991b1b; border: 1px solid #fecaca;
    border-radius: 8px; padding: 10px 14px; font-size: 13px;
    margin-top: 14px; display: none;
  }

  /* Badge de usuário logado */
  #authUserBadge {
    position: fixed; top: 10px; right: 16px; z-index: 9999;
    background: rgba(255,255,255,0.12); backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 999px; padding: 5px 14px 5px 10px;
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: #fff; font-family: 'Segoe UI', sans-serif;
    cursor: pointer; user-select: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: none;
  }
  #authUserBadge .auth-badge-avatar {
    width: 24px; height: 24px; border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff, #072d91);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 900; color: #fff;
  }
  #authUserBadge:hover { background: rgba(255,255,255,0.22); }

  /* Modal de troca de senha */
  #authChangePwdModal {
    position: fixed; inset: 0; z-index: 99998;
    background: rgba(0,0,0,0.55); display: none;
    align-items: center; justify-content: center;
    font-family: 'Segoe UI', sans-serif;
  }
  #authChangePwdModal.open { display: flex; }
  #authChangePwdCard {
    background: #fff; border-radius: 18px; padding: 32px 28px;
    width: 340px; max-width: 94vw;
    box-shadow: 0 20px 50px rgba(0,0,0,0.28);
  }
  #authChangePwdCard h3 { font-size: 18px; color: #1a1a2e; margin-bottom: 20px; font-weight: 800; }
  #authChangePwdCard label {
    display: block; font-size: 12px; font-weight: 700;
    color: #555; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 5px;
  }
  #authChangePwdCard input {
    width: 100%; padding: 10px 13px; border: 1.5px solid #d0d7e2;
    border-radius: 8px; font-size: 14px; margin-bottom: 14px;
    outline: none; box-sizing: border-box;
  }
  #authChangePwdCard input:focus { border-color: #072d91; }
  .auth-pwd-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
  #authPwdError {
    background: #fef2f2; color: #991b1b; border: 1px solid #fecaca;
    border-radius: 7px; padding: 9px 12px; font-size: 13px;
    margin-top: 8px; display: none;
  }

  /* Dropdown do usuário */
  #authUserMenu {
    position: fixed; top: 46px; right: 16px; z-index: 9998;
    background: #fff; border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    min-width: 200px; padding: 8px 0; display: none;
    font-family: 'Segoe UI', sans-serif;
  }
  #authUserMenu.open { display: block; }
  .auth-menu-item {
    padding: 10px 18px; font-size: 14px; cursor: pointer;
    display: flex; align-items: center; gap: 9px; color: #333;
    transition: background 0.15s;
  }
  .auth-menu-item:hover { background: #f0f4ff; }
  .auth-menu-sep { height: 1px; background: #eee; margin: 4px 0; }
  .auth-menu-role {
    padding: 8px 18px 4px; font-size: 11px; color: #999;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  }

  /* Painel de usuários na tela de configurações */
  #authConfigSection {
    background: #fff; border-radius: 16px; padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07); margin-top: 18px;
  }
  #authConfigSection .auth-config-title {
    font-size: 17px; font-weight: 800; color: #1a1a2e; margin-bottom: 6px;
  }
  #authConfigSection .auth-config-sub {
    font-size: 13px; color: #777; margin-bottom: 18px;
  }
  .auth-user-row {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border: 1px solid #e5e9f2; border-radius: 10px;
    margin-bottom: 10px; background: #f9fbff;
  }
  .auth-user-row .auth-user-info { flex: 1; }
  .auth-user-row .auth-user-name { font-weight: 700; font-size: 14px; color: #1a1a2e; }
  .auth-user-row .auth-user-role {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.4px; padding: 2px 8px; border-radius: 5px;
    display: inline-block; margin-top: 3px;
  }
  .role-adm { background: #dbeafe; color: #1e40af; }
  .role-suporte { background: #d1fae5; color: #065f46; }
  .role-operacao { background: #fef3c7; color: #92400e; }
  .role-compras { background: #fee2e2; color: #991b1b; }
  .auth-edit-btn {
    padding: 7px 14px; font-size: 13px; font-weight: 700;
    background: #e0e7ff; color: #3730a3; border: none;
    border-radius: 8px; cursor: pointer; transition: background 0.2s;
  }
  .auth-edit-btn:hover { background: #c7d2fe; }
  .auth-delete-btn {
    padding: 7px 14px; font-size: 13px; font-weight: 800;
    background: #fee2e2; color: #991b1b; border: none;
    border-radius: 8px; cursor: pointer; transition: background 0.2s, transform 0.15s;
  }
  .auth-delete-btn:hover { background: #fecaca; transform: translateY(-1px); }
  .auth-new-user-form {
    display: grid; grid-template-columns: 1.2fr 1fr 1fr auto;
    gap: 10px; align-items: end; margin-bottom: 18px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 14px; padding: 14px;
  }
  .auth-new-user-form label {
    display: block; font-size: 11px; font-weight: 800;
    color: #475569; text-transform: uppercase; letter-spacing: .35px;
    margin-bottom: 5px;
  }
  .auth-new-user-form input, .auth-new-user-form select {
    width: 100%; height: 40px; border: 1px solid #cbd5e1;
    border-radius: 10px; padding: 0 12px; font-size: 14px;
    outline: none; background: #fff; box-sizing: border-box;
  }
  .auth-new-user-form input:focus, .auth-new-user-form select:focus {
    border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.10);
  }
  @media (max-width: 900px) {
    .auth-new-user-form { grid-template-columns: 1fr; }
  }
